How to setup python on top of docker container?

Durvesh Palkar
2 min readMar 11, 2021

--

In this article I’ll show you how to setup Python interpreter on top of docker container. Refer my previous blog to know more about docker containers and how to install it in your system.

✒ Step 1: Start Docker service and launch a container

Check if the docker service is active or not using the command systemctl status docker . If not start it using systemctl start docker

In my case it is active. Let’s launch a centos container using the command docker run -it --name pydoc1 centos:latest

✒ Step 2: Install Python3 in the launched docker container

Use the command yum install python3 to install python3 in this container

✒ Step 3: Check the installation and try running a python code

Launch the python live interpreter to check the installation using the command python3 . Also try running some python code. Use exit() to close the interpreter.

And that’s it !!

--

--

No responses yet