7.2: Docker Task
What is Docker??
Docker is a set of platform as a service (PaaS) 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. Because all of the containers share the services of a single operating system kernel, they use fewer resources than virtual machines.
Docker is an open platform for developing, shipping, and running applications. Docker enables us to separate our applications from our infrastructure so we can deliver software quickly. With Docker, we can manage our infrastructure in the same way we manage our applications.
In this article I have done following tasks using docker
- Configure HTTPD Server on Docker Container
- Set Up Python Interpreter and running Python Code on Docker Container
* First we have to setup docker
for that you need to install docker.
"yum install docker" this command we have to use to install docker.
to start docker - "systemctl start docker"
to check status of docker - "systemctl status docker"
Now to check which images we have to run the docker container for that;
"docker images" command is used.
Right now I don't have images to pull the image from web we have to tell docker
for this "docker pull <image name/OS name>" is used.
Now I have downloaded the centos image from web.
To run the container on docker
"docker run -i -t --name <OS name> <image name>" this command is used.
as you can see i have one container running.
** Configuring HTTPD Server on Docker Container
to install httpd server "yum install httpd" command is used.
Now we have to configure the /var/www/html/ file
I have written small code of html inside this file.
to start httpd server we can use ""systemctl start httpd" or "/usr/sbin/httpd"
Now by running "10.88.0.6" on browser I get the following output as the httpd server has been worked.
** Setting Up Python Interpreter and running Python Code on Docker Container
to install python3 - "yum install python3"
Now create one small python code
as you can see I get the output.
Thank You!!!!