Configuring HTTPD Server on Docker Container and Setting up Python Interpreter and running Python Code on Docker Container

SIBAYAN BAG
3 min readMar 14, 2021

--

First install docker on our base OS in my case i am using redhat Linux :

-> first we need to create a yum repository and update the url so that they go and download for us..

set up yum repository:

a> go to directory : /etc/yum.repos.d

b> create a file with any name but extension should be .repo

c> In the file write the docker link to download the docker

d> start the docker service systemctl start docker

Now run the command to install docker :

command : yum install docker-ce — nobest — allowerasing

-> Now pull the image from the docker hub to launch a container :

command : docker pull os_name:os_version

To check image is downloaded or not :

command : docker images

Now launch one container using the image that we downloaded above :

command : docker run -it name os_name:os_version

Now Check the IP of the docker container :

command : ifconfig

Configuring HTTPD Server on Docker Container :

  1. Install httpd on docker container:

command : yum install httpd

2. Go to httpd configure folder /var/www/html and create one html file :

command : cd /var/www/html

3. Start the httpd service :

command : /usr/sbin/httpd

4. Now check it is running or not in the browser :

Hence WEB Server is Configured …

Python Interpreter and running Python Code on Docker Container

  1. Install python Interpreter in Container :

command : yum install python3

2. run python code in container on python interpreter :

command : python3

Hence Task Completed !!!

Thanks For Reading !!!

--

--

No responses yet