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

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

Firstly we have to start with installing the docker on the OS we can do it by the following command-

$ yum install docker-ce --nobest -y

Then we have to download the images ,images means image of the OS like ubuntu , centos etc. by using the command-

docker pull _IMAGE NAME_

example- $ docker pull centos:7

we can check the all images using the command-

$ docker images

we can also check information of docker installation as-

$ docker info

For checking information of all images , use the command-

$ docker ps -a

Now we have to launch the OS using the command-

$ docker run -it --name task7 centos:latest

No alt text provided for this image

Now we have to configure the httpd server inside docker as follows-

$ yum install httpd

No alt text provided for this image

Now go to the directory of html as follows-

$ cd /var/www/html

And also make the file in that named as task.html-

No alt text provided for this image
No alt text provided for this image

Now start the httpd server inside docker as follows-

$ /usr/sbin/httpd

we cannot use systemctl start httpd as docker doesnot understood this command.

Now we can check this in the web browser(our html file). Firstlt install ifconfig as-

$ yum install net-tools

No alt text provided for this image

Now use $ ifconfig command to check IP address and then run in web browser-

No alt text provided for this image

Now install python interpreter as follows in docker-

$ yum install python3

No alt text provided for this image
No alt text provided for this image

Now make the file as task.py

No alt text provided for this image
No alt text provided for this image

Now run this using- python3 task.py

No alt text provided for this image

Thank you.

To view or add a comment, sign in

More articles by Saket Sharma

  • AI on AWS Workshop

    The key points of AI on AWS workshop are given as: #day1 - how to make cloud intelligent and allow to read the image -…

  • Git and GitHub workshop

    The workshop was all about the deep concepts of the Git and Github , this workshop was delivered by the world record…

  • Wordpress with RDS service

    ARTH - Task 18 👨🏻💻 Task Description📄 🔅 Create an AWS EC2 instance 🔅 Configure the instance with Apache…

    2 Comments
  • Chat program using UDP(with and without multi-threading)

    ARTH - Task 17 👨🏻💻 Task Description📄 🔅-17.1 Create your own Chat Servers, and establish a network to transfer…

  • ARTH Task 14.3

    ARTH - Task 14 👨🏻💻 Task Description📄 🔰 14.3 Create an Ansible Playbook which will dynamically load the variable…

  • Retrieving new container IP

    ARTH - Task 14 👨🏻💻 Task Description📄 🔰 14.2 Further in ARTH - Task 10 have to create an Ansible playbook that…

  • Task 12.2

    ARTH ARTH - Task 12 👨💻 Task Description 📃 12.2 Configure the same setup as 12.

  • Expert session: Ansible tower

    First of all I would like to thank my mentor Vimal daga sir and Preeti maam who have arranged Industry Expert Practical…

  • What is kubernetes and its case study : Nokia

    What is kubernetes? Kubernetes is the container orchestrator that was developed at Google which has been donated to the…

  • ping google but not able to ping Facebook from same system

    This task is very interesting , the task details is given as- ARTH - Task 13 👨🏻💻 Task Description📄 🔰 Create a…

Others also viewed

Explore content categories