Setting up Python Interpreter and running Python Code on Docker Container

Sanat Dash
2 min readJan 13, 2022

1 : We need to install docker

command to install docker.# yum install docker-ce — nobest

2 : Start docker services And to check status :

command to start docker services

# systemctl start docker

command to check status of docker services

#systemctl status docker

3 : To launch any OS we need image for that

docker pull <image_name>:<version>

I have used centos:7

#ocker pull centos:7

4 : To launch docker container :

command to launch docker container

I have launched centos:7 by assigning name as python_int

#docker run -it — name python_int centos:7

5.To use python on top of docker first thing we have to do is to install the python software using following command.

“yum install python3”

6.Now let’s write some code on Python Interpreter..

For getting into python interpreter we have to use command #python3

then we can now write our python code over interpreter and we can run our code as well.

Task completed successfully !😃🎇