Setting up Python Interpreter and running Python Code on Docker Container

In this blog, I am going to set up Python Interpreter on a docker container and run python code on a Docker container. The prerequisite for this practical is that the docker engineer should be running.

Step 1: Launch the docker container with centos image

docker run -it — name pythonos centos

Now we can check the container is running or not with docker ps command.

docker ps

We can see that one container from the centos image is running.

Step 2: Install python3 software in the container.

yum install python3

We can check the version of python 3 software.

Step 3: Write Python code in the container.

Now run the python code.

We can see that we can easily run the python code inside the docker container.

Thank You !!