Configuring HTTPD server on docker container and setting up Python Interpreter on docker container.

Ishika Mandloi
Nov 11, 2020

--

What is docker?

Docker is a software platform for building applications based on containers — small and lightweight execution environments that make shared use of the operating system kernel but otherwise run in isolation from one another.

Lets start with configuring HTTPD server on docker container!!

A. Configuring httpd server on docker

  1. First create one docker container using command

#docker run -it — name <name> <image>:<7>

2. After creating container , docker container terminal will start, Then install HTTPD service in it using yum command.

#yum install httpd

3. To enable docker service run command

#/usr/sbin/httpd

Now, our httpd service has started we can start with html.

4. run command #cd /var/www/html to go inside html directory were we can create html page which is to be hosted.

5. Inside this directory we can create webpage for eg. task7.html

Here we have configured and started httpd service.

B. Setting up Python interpreter on docker container.

  1. First, we have to install python3 on docker container using yum command

#yum install python3

2. Now we can check if python3 is successfully installed or not. Using command

#python3 -V

it will show you version of python that is installed in container.

Now , setup of python3 interpreter in completed . We can create python file in container using command

#vim task7.py

and run this python program using command

#python3 task7.py

also we can read the read file using cat command

#cat task7.py

Here we complete setting up python3 interpreter in docker container.

Thank you! Hope you all enjoyed it✌✌

keep learning !!!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet