Setting up python Interpreter and running python in Docker Container….

--

In this Article we are going to explain how to install and run the python Interpreter in Docker.

Here we are going to setup our python Interpreter in Docker by using AWS Instance.

To Run python in AWS Instance we need to follow these steps👇:

Step 1: Install and Run the Docker Container in the Instance.

Step 2: Install python interpreter in Docker

Step 3: Run python in Docker Container.

NOW, lets see How we implemented those steps👇👇👇

STEP 1:

Installing and Running the Docker Container in the Instance.

First we launched the AWS instance and then we need Docker to run the whole process. So, To install Docker the command is

>>> yum install docker

And Here we need to launch our container ,to launch it we need to pull an OS image ( ex: centos:7) by using command

>>> docker pull centos:7

To launch/run our Docker container we need to use the command

>>> docker run — it — name < name for container > <container name>

We launched our docker container as shown in above figure.

STEP 2:

Install python interpreter in Docker

To install python in Container we use the command

>>> yum install python3

We can check in which version python installed in our container by using command

>>>python3 — version

STEP 3:

Run python in Docker Container

To run python interpreter we use command

>>> python3

Also created and executed the python file by using command

>>>python3 <filename>

Finally , In this way we setup and run the Python interpreter in docker Container successfully….. !!!

:)

--

--

No responses yet