Docker Images and Docker Containers
3 min read
Peace to you all , Here is the Link to my previous blog, Where I have posted about Docker , Containers and DevOps. It is the day 3 of documenting my DevOps Journey
Here In this blog, there is a practical hands-on approach to running docker container in your machine.
Docker desktop can be installed from this Link .
Get Started with Docker | Docker
It will download everything it needs to run on its own .
Once downloaded it will demand to restart , after restarting try running docker . If WSL 2 installation is incomplete error pops up , download your respective Linux kernel update package if you are using windows.
Once the download is completed and all set , Run
in the command prompt , to check whether docker works fine.
Once you receive the version , we are good to go.
The command line interface has everything that can be done and docker desktop can be used to visualize it in a GUI.
A simple webApp
Getting Hands-on , let’s start by building a small html file .
Visual studio code is the text editor I predominantly use and it has tons of features and that requires a separate blog .
It is not necessary you have to have a Visual studio code now , Open Notepad and create a simple HTML page or just copy-paste the below content.
<h1> This is a sample Web App </h1>
Save it as an HTML file.
Try opening it and it should display like this in the browser ,
What is an Nginx?
It is a web server , I use Nginx to demonstrate hosting a web application in the web server.
The official image chip and verified publisher chip makes the image trustworthy and it is on our own risk to use any other docker images .
Open Nginx and explore the page .
The command to pull the image will be found on the page itself , Here it is
docker pull nginx
Running it in the command prompt will pull the image from DockerHub .
Once the pull is completed ,
the above command should show the details of the docker image.
Yes , We have successfully pulled an image from DockerHub.
Now we can run this and check in the browser as well .
docker run -p 80:80 -d nginx
See you Tomorrow
Okay . So hold on, stay with me as we get to know docker more and DevOps even more.
Okay Then , Will get back Tomorrow with more!
Peace be upon you!
Did you find this article valuable?
Support Shajith by becoming a sponsor. Any amount is appreciated!