Docker

How to launch and use a Container for simple webserver and Python interpreter.

Mukul Jeveriya
3 min readMay 10, 2021

--

In this article I am going to do some task on docker which is listed below.

Task:

  • Configure HTTPD server on Docker Container
  • Setting up Python Interpreter and running Python Code on Docker Container.

Let’s start..

Firstly we have to launch a docker container

docker run -it -p <any port:80> --name <any name> <docker image>

This is the command to simple deploy a docker container.

Now we are inside docker container. So let check whether the HTTPD software install or not.

rpm -q httpdcommand to check any program install or not

Let install the HTTPD program.

yum install httpd command to install httpd software 

In above image you can see the software install successfully.

Now start the httpd services for this

httpd -k start

Httpd service is started just put our webpages on /var/www/html folder. So I wrote some simple httpd code in this folder. Now just hit the IP On browser.

Hurray!!! Look our webpage is live.

Now come to the Python Interpreter. For this we have to install python in container.

yum install python3command for installing python 3.
python3 --version command to check the version of python 

In the above image we can simply use pyhton3 inside docker containerne

Thanks for reading , I hope you like the Blog!!!

--

--

No responses yet