Martin Abreu
Martin Abreu

Reputation: 51

Why isn't this container running properly?

I'm trying to run a container on Docker and I'm getting the following error message:

Successfully built 9df8ac137547
Successfully tagged ex-build-dev:latest
$ build-dev % docker container run -it -v "$(pwd):/app" -p 80:8000 --name python-server ex-build-dev
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"usr/local/bin/python\": stat usr/local/bin/python: no such file or directory": unknown.

Here is my Dockerfile used to build the image:

FROM python:3.6
LABEL maintainer 'Martin'

RUN useradd www && \
    mkdir /app && \
    mkdir /log && \
    chown www /log

USER www
VOLUME /log
WORKDIR /app
EXPOSE 8000

ENTRYPOINT ["usr/local/bin/python"]
CMD ["run.py"]

Does anyone know isn't the ENTRYPOINT being recognized?

Upvotes: 2

Views: 133

Answers (1)

Peter Badida
Peter Badida

Reputation: 12189

You are using WORKDIR /app together with ENTRYPOINT ["usr/local/bin/python"] and that ends up with executing:

/app/usr/local/bin/python

instead of:

/usr/local/bin/python

Add absolute path to ENTRYPOINT directive, in your case: /usr/local/bin/python.

Upvotes: 1

Related Questions