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

I was the same issue, and in my case, I was replacing the workdir in my docker-compose.yml for bind empy diretory, this removed my entrypoint file.

Sorry for my English :slight_smile: its not my primery language