Docker Community Forums

Share and learn in the Docker community.

Python: can't open file 'app.py': [Errno 2] No such file or directory

Hi

I am having issues with python images. It is probably related to configuration and paths

I can create the image and run it correctly, but it fails everytime with code 2. In the logs i can see python: can’t open file ‘app.py’: [Errno 2] No such file or directory

my dockerfile is as follows

FROM ubuntu:latest
WORKDIR /Users/javidr/myapp/
ENTRYPOINT [“python”]
CMD [“app.py”]

Any idea on what i am doing wrong? I expect that setting workdir as the folder where the app.py is (it is /Users/javidr/myapp/app.py), it would be found, isnt it?

Thanks