I am trying to deploy a containerized webapp on Openshift by a helm chart. When I deploy the app I get the following error in the pod logs -
Events:
Type Reason Age From Message
Normal Pulled 14m kubelet Successfully pulled image "<private-gitlab-registry-docker-image>:latest" in 3.787555091s
Warning Failed 14m kubelet Error: container create failed: time="2022-11-11T13:51:47Z" level=error msg="runc create failed: unable to start container process: exec: \"python3 src/myapp.py\": stat python3 src/myapp.py: no such file or directory"
Here is the dockerfile -
FROM <private-gitlab-registry-centos-image>
ADD files/etc/yum.repos.d/* /etc/yum.repos.d/
RUN yum update -y
WORKDIR /app
RUN yum install -y python-keystoneclient python3-flask python3-keystoneauth1 python3-redis python3-werkzeug python3-pip python3-keystoneclient
RUN pip install flask-caching
COPY . /app
ENTRYPOINT [ "python3" ]
CMD [ "src/myapp.py" ]
When I manually try to run this docker image, it works just fine. But when I deploy it on Kubernetes, kubelet throws the above error.
ls app/
, have you tried topwd
, orls
? otherwise,command: [ "/bin/sh" ]
andargs: [ "-c", "sleep 86400" ]
, then get in and troubleshoot it live.