Launching the Webserver and the Python Interpreter On the top of Docker Container !!!!
Anushka Visapure
DevOps Engineer at BetaQue???? IT Engineer???? 1X AWS Certified || 1X Microsoft Certified?? Trained In Kubernetes || Terraform || Git and GitHub || GitHub Action || Docker || Ansible || AWS || GCP !!
!! ?????????? ?????????????????????? !!
?? 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 "
Step 2: we have to check whether the docker software has been installed or not by checking it's version
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 "
Step 4: Now after installing the docker. We have to pull the image for installation of docker container
Now check the image has been pulled or not by using the command "docker images"
Step 5: Launch the container by using the command
" docker run -it --name 'name_of_container' 'image_name' "
After launching the container now check whether the container has been launched or not
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
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
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
Now check the IP of the container by using the command " ifconfig "
Now run the command to see the webpage from the base OS
" curl https://Containerip/Webpage.html "
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 "
Step 2: we have to check whether the python software has been installed or not by checking it's version
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
Here I am successfully completed my Task 7
Thank You so Much for Reading !!!
Aspiring Software Engineer
3 年? it will helpful ??Anushka Visapure
Site Reliability Engineer
3 年Well explained
DevOps Engineer at SmartBear
3 年Good going Anushka Visapure
Java|| Python||Linux and Networking||Hadoop ||Ansible || Kubernetes|| Jenkins|| AWS ||Docker||DSA
3 年Nice Anushka Visapure ??
Associate Software Engineer @Veritas Technologies LLC | Building Kubernetes Protection | Top 1% @Leetcode | Specialist @Codeforces
3 年Great job Anushka Visapure ???? ?