diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c0b2adc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +# A dockerfile must always start by importing the base image. +# We use the keyword 'FROM' to do that. +# In our example, we want import the python image. +# So we write 'python' for the image name and 'latest' for the version. +FROM python:latest + +# In order to launch our python code, we must import it into our image. +# We use the keyword 'COPY' to do that. +# The first parameter 'main.py' is the name of the file on the host. +# The second parameter '/' is the path where to put the file on the image. +# Here we put the file at the image root folder. +COPY test_python.py / + +# We need to define the command to launch when we are going to run the image. +# We use the keyword 'CMD' to do that. +# The following command will execute "python ./main.py". +CMD [ "python", "./test_python.py" ] diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..d86bac9 --- /dev/null +++ b/readme.txt @@ -0,0 +1 @@ +OK diff --git a/test_python.py b/test_python.py index 6ff0c2c..3da09dd 100644 --- a/test_python.py +++ b/test_python.py @@ -1 +1 @@ -print("HELLO DEV") +print("HELLO Ahtisham - HELLO FROM PY")