Launching the Webserver and the Python Interpreter On the top of Docker Container !!!!

Launching the Webserver and the Python Interpreter On the top of Docker Container !!!!

!! ?????????? ?????????????????????? !!

?? TASK DESCRIPTION:

?? Configuring HTTPD Server on Docker Container

?? Setting up Python Interpreter and running Python Code on Docker Container

?? What is Docker?

Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production.

? The Docker platform

Docker provides the ability to package and run an application in a loosely isolated environment called a Container. The isolation and security allow you to run many containers simultaneously on a given host. Containers are lightweight because they don’t need the extra load of a hypervisor, but run directly within the host machine’s kernel. This means you can run more containers on a given hardware combination than if you were using virtual machines. You can even run Docker containers within host machines that are actually virtual machines!

Docker provides tooling and a platform to manage the lifecycle of your containers:

  • Develop your application and its supporting components using containers.
  • The container becomes the unit for distributing and testing your application.
  • When you’re ready, deploy your application into your production environment, as a container or an orchestrated service. This works the same whether your production environment is a local data center, a cloud provider, or a hybrid of the two.

Steps :

Step 1: For using the docker first we have to install it by using the command " yum install docker "

No alt text provided for this image

Step 2: we have to check whether the docker software has been installed or not by checking it's version

No alt text provided for this image

Step 3: For using the docker service, first we have to start it by using the command " systemctl start docker "

And then we have to check whether the service has been started or not by using the command " systemctl status docker "

No alt text provided for this image

Step 4: Now after installing the docker. We have to pull the image for installation of docker container

No alt text provided for this image

Now check the image has been pulled or not by using the command "docker images"

No alt text provided for this image

Step 5: Launch the container by using the command

" docker run -it --name 'name_of_container' 'image_name' "

No alt text provided for this image

After launching the container now check whether the container has been launched or not

No alt text provided for this image

By using the docker ps -a command. You can see that my container named Task_7 has been launched about a minute ago. "docker ps -a" gives the list of Containers which is launched and which were launched at some point in time.

Step 6: Now install the httpd software on the top of the newly launched container

No alt text provided for this image

Now go to the directory cd /var/www/html/. Create the HTML file Task_7.html by using the command " vim Task_7.html " and then read the file by using the " cat Task_7.html " command

No alt text provided for this image

After creating the HTML file now we have to start the service. Generally in Linux, to start any service we can use the " systemctl " command but docker doesn't support the " systemctl " command. That's way to start the httpd service running on the top of docker container we use "/usr/sbin/httpd" command

No alt text provided for this image

Now check the IP of the container by using the command " ifconfig "

No alt text provided for this image

Now run the command to see the webpage from the base OS

" curl https://Containerip/Webpage.html "

No alt text provided for this image

So you can see the httpd server has been configured successfully and it's working fine !!!

!!!!!!! Setting up the Python Environment !!!!!!!

Step 1: Install the Python software using the command given below:

" yum install python3 "

No alt text provided for this image

Step 2: we have to check whether the python software has been installed or not by checking it's version

No alt text provided for this image

Step 3: Now run the " python3 " command to get python interpreter and then run any code to check the python is working good or not

No alt text provided for this image

Here I am successfully completed my Task 7

Thank You so Much for Reading !!!

Avadhut Shinde

Aspiring Software Engineer

3 年

? it will helpful ??Anushka Visapure

Sachin Kumar

Site Reliability Engineer

3 年

Well explained

Simran Kukareja

DevOps Engineer at SmartBear

3 年

Good going Anushka Visapure

Aditi Singh

Java|| Python||Linux and Networking||Hadoop ||Ansible || Kubernetes|| Jenkins|| AWS ||Docker||DSA

3 年
Nilesh Gopale

Associate Software Engineer @Veritas Technologies LLC | Building Kubernetes Protection | Top 1% @Leetcode | Specialist @Codeforces

3 年

Great job Anushka Visapure ???? ?

回复

要查看或添加评论,请登录

社区洞察

其他会员也浏览了