After containerizing an old python application into docker image, we tried to deploy the image to OpenShift. The container is built using docker file as below, and UBI8 as base image. The python package used comes together with the application
Dockerfile:
FROM my.artifactory.company.com/ubi8:latest
WORKDIR /appl/web/myapp
COPY myapp /appl/web/myapp
EXPOSE 8585
The Deployment pulls the image and execute the following:
lifecycle:
postStart:
exec:
command:
- /appl/web/myapp/python-2.7/bin/python
- /appl/web/myapp/supervisor/supervisor.py
- echo Attemp to run supervisor
The pod failed to start and the following error is found:
Exec lifecycle hook ([/appl/web/myapp/python-2.7/bin/python /appl/web/myapp/supervisor/supervisor.py echo Attemp to run supervisor]) for Container "myapp" in Pod "myapp-684b6878b4-cm979_my-app-namespace(83d1713d-4c78-404d-ad1b-8ab89fc5fc7a)" failed - error: rpc error: code = Unknown desc = command error: time="2024-03-11T15:11:06Z" level=fatal msg="nsexec-1[2194562]: failed to open /proc/2194510/ns/ipc: No such file or directory" time="2024-03-11T15:11:06Z" level=fatal msg="nsexec-0[2194561]: failed to sync with stage-1: next state: Invalid argument" time="2024-03-11T15:11:06Z" level=error msg="exec failed: unable to start container process: error executing setns process: exit status 1" , stdout: , stderr: , exit code -1, message: ""
The application is running using python2 and listen to a tcp port.
Been trying to look for how OpenShift handle the IPC namespace but could not find any definitive answer to this one. Any info would be appreciated.
UPDATE
Switching over to use CMD in the Dockerfile, i'm getting the following error instead:
/bin/sh: /appl/web/myapp/python-2.7/bin/python: Permission denied
The updated Dockerfile as below:
FROM my.artifactory.company.com/ubi8:latest
WORKDIR /appl/web/myapp
COPY myapp /appl/web/myapp
EXPOSE 8585
CMD /appl/web/myapp/python-2.7/bin/python /appl/web/myapp/supervisor/supervisor.py