Configuring HTTPD Server & Running python on Docker Container.
Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels.
To install Docker
yum install docker-ce --nobest
This installs docker in our OS. Now we can get docker containers using docker images via docker hub.
We need to start docker Services and have to enable docker services using the command
systemctl start docker
systemctl enable docker
To get Docker images we can use docker pull command.
docker pull <image_name>:<version>
I am installing centos image using docker pull centos
To run this image use command
docker run -it centos
To configure a web server in any system we have to do 3 steps:
Installing the software.
yum install httpd
Writing a HTML code in /var/www/html folder.
Starting the service.
To install software here I am using Apache web server, run
To see this HTML code on web site we need the IP of the docker container. To know IP we use ifconfig command.
But initially, ifconfig command is not present in the docker container. To get this command we need to install net-tools module.
yum install net-tools
After installing net-tools module we can check our ip using ifconfig command.
Now using this IP we can see the output in the web browser.
Installing Python in docker container
we can check whether python installed or not by using command
here i copied python file from local to docker containers using command
docker cp <file name> <container_name:<path>
now we can check copied file in container by entering into same directory.
Finally we can run python file in docker container.
Finally , done with the task 7.2 ….
🌟 🌠 Thanks for reading…..