Docker run Error: /bin/sh: 1: python: not found Docker run Error: /bin/sh: 1: python: not found flask flask

Docker run Error: /bin/sh: 1: python: not found


Since you are only install python3 inside the docker image as shown here

RUN apt-get update && apt-get install -y python3 python3-pip

So you will need to run python3 instead of python in this line: CMD python .main.py

And you have a typo in the script name. It should be main.py instead of .main.py. Or it should be ./main.py

So change it to CMD python3 ./main.py

And if you still have error, you probably need to add this line in the Dockerfile above line of EXPOSE 5000:

WORKDIR /opt/MyApp-test