Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. It is founded by Solomon Hykes at DockerCon. Solomon Hykes built a wonky open-source project a decade ago that later took on the name Docker and attained a private market valuation of over $1 billion.
Python is an interpreted, high-level, and general-purpose programming language. Python’s design philosophy emphasizes code readability with its notable use of significant whitespace.
Steps for configuring the python interpreter on top of docker:
At first, we need to download the os image from the docker hub. In my case I am downloading centos version 8.
the command to download:- docker pull os_image:version
Now we already downloaded the os image, for checking the images downloaded we have the docker images command.
To run the docker container we have a command:
docker run -it — name name_of_container os_name:version
Our main purpose is to download and configure the python interpreter. So we have to check which software provides the python software. We have a command which shows which software provides the python.
the command to see: yum whatprovides python3
Here we get the name of the software name of the python3. The software name is python36.
Here we install the python with python36 software.
command: yum install python36
To see Python is properly installed we can see it by python3 -V command. Here we see the version of python.
Python interpreter is properly installed so we create the directory for python code.
Now we create the code in python. Here is the code I have written in python.
Here is the python code that I have written.
Here we run the code.
command: python3 name.py
Here we see the integration of docker and python. We used the yum command to install python. And we write and run the python code in docker.