Setting up Python Interpreter and running Python Code on Docker Container

Mihir Patel
Nov 11, 2020

--

Task details:

Run python on any docker container

step 1: First pull image and run container

docker run -it — name pythoncontainer centos

Here run is used for pull and run image can both.

Now automatic landed on centos container.

You can run any container same as centos by following command

docker run -it — name pythoncontainer CONTAINER_NAME

Here we use centos image container for run python

step 2: Run python

In redhat os , python3 is inbuilt so we can use directly but in container not pyhton3 is inbuilt.

So we need to install python3 software

Before install python3 : we will show command not found

To install python3

yum install python3

Now We add python3 in our centos container

Run python code:

Conclusion:

how we can python code in any container .

Thank you

--

--

Mihir Patel
Mihir Patel

No responses yet