Setting up Python interpreter on Docker Container

Milind Rastogi
Analytics Vidhya
Published in
Mar 25, 2021


In this blog I will be giving you a step by step instruction for dockerizing your python interpreter.

So let’s get started !!

Step1: Launching a docker container

I will be using the centos as my container’s operating system. You can also use any other docker image like fedora and ubuntu.

For downloading the docker image use the below command

docker pull centos

For launching a container

docker run -it --name python_interpretor centos

Step2: Installing the python interpreter

Use the yum package manager for the installation

yum install python3
Testing the python interpreter

Step3: Starting the python on launching the container

For this we have to configure the /root/.bashrc file. So now just adds the path of python

Now after launching our docker container we can see that python interpreter automatically started

Thank you for reading!