7.2 Docker Task

Jaindivya
3 min readMar 9, 2021

1.Configuring HTTPD Server on Docker Container

2.Setting up Python Interpreter and running Python Code on Docker Container

1.Configuring HTTPD Server on Docker Container

Step-1

To check whether my docker software has been installed or not.We use the below-mentioned command

Step-2

We can start the docker service by using the docker start command and enable the docker service permanently by using the docker enable command

and can also check the docker status whether it is enabled or not by using docker status command

Step-3

After launching the docker container, we have to use this command to run the container.

Step-4

The next step is to install the httpd software.

Step-5

Now,by going to the directory cd /var/www/html,we will make a HTML file docker.html

Step-6

Now starting the services.Services will not work if we are starting it using

###systemctl start httpd

So,that's why now we will use this command /usr/sbin/httpd

Step-7

Next is we will copy the ip that is shown above and will use the ip in the command given below..

Now use the command curl http://Containerip/Webpage.html

Voilaaa! Now we can see that the httpd server is configured and is working fine and we can see the output…..

2.Setting up Python Interpreter and running Python Code on Docker Container

Step-1

Here we will pull one more image using the command docker pull imagename:version

Step 2

Docker images command will show all the images…

Step 3

We run the docker container

Step-4

Install the Python software using the command given below

Step-5

We will then create a separate workspace for python programs using the command given below

In the above examples we can see that I have made a directory for python programs and I am going into the directory using the cd command using vi editor I am creating a python file

Step-6

After that, I have been running the python code using the command python3 filename.py

So the objective of my task has been accomplished…..

ENjoy reaDing…..

— -Divya Jain

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

Write a response