# Docker Images and Docker Containers

# Introduction

Peace to you all , Here is the Link to my previous [blog](https://shajith.hashnode.dev/dockers-and-containers), Where I have posted about Docker , Containers and DevOps.
It is the day 3 of documenting my DevOps [Journey](https://github.com/shajith-it-is/devops-journey)

Here In this blog, there is a practical hands-on approach to running docker container in your machine.

# Getting Started

Docker desktop can be installed from this Link .

[Get Started with Docker | Docker](https://www.docker.com/get-started)

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](https://docs.microsoft.com/en-gb/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package) if you are using windows.

# Docker Desktop

Once the download is completed and all set , Run 

```
docker  --version 

```
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 ](https://code.visualstudio.com/download) 
 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 ,


![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1642909992583/rL20N6nFA.png)

# Nginx

What is an Nginx?

It is a web server , I use Nginx to demonstrate hosting a web application in the web server.

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1642910083915/Vxd1P3bIq.png)

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  ,

```
docker images

```
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

```

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1642909965800/SXnvaIClI.png)

# 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!
