I'm starting with Docker. I have started with a Hello World script in Python 3. This is my Dockerfile:
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install python3
COPY . hello.py
CMD python3 hello.py
In the same directory, I have this python script:
if __name__ == "__main__":
print("Hello World!");
I have built the image with this command:
docker build -t home/ubuntu-python-hello .
So far, so good. But when I try to run the script with this command:
docker run home/ubuntu-python-hello
I get this error:
/usr/bin/python3: can't find '__main__' module in 'hello.py'
What am I doing wrong? Any advice or suggestion is accepted, I'm just a newbie.
Thanks.
COPY hello.py hello.pyhello.py(in docker container)