My First Day of Learning Docker
Published: 2021-08-11 11:56:21

Containers are quickly becoming an industry standard for deployment of software applications. But question here is: how containers came into being, so I came across [docker] (https://www.docker.com/) and I learned.

In this blog I'll discuss what I have learned so far about docker.

- What is docker?
- Components of Docker
- Container vs VM
- Basic Commands.


## What is docker?

 Docker delivers software in containers, which simplifies the process by packaging everything it takes to run an application.

There are numerous advantages to using containers to deploy applications.
- *Isolated* — Applications have their own libraries; no conflicts will arise from different libraries in other applications.
- *Limited (limits on CPU/memory)* — Applications may not hog resources from other applications.
- *Portable* — The container contains everything it needs and is not tied to an OS or Cloud provider.
- *Lightweight* — The kernel is shared, making it much smaller and faster than a full OS image.


## Components of Docker

- **Docker file**  is a text document that contains necessary commands which on execution helps assemble a Docker Image.

- **Docker Image** it is a set of instructions which is used to build containers, consisting of application code with all the dependencies and libraries. It is portable so it can easily be shared between developers and operators. 


- **Container** is a way of packing application with all its dependencies and configuration files. A container is a running instance of our image. 


- **Docker Engine** supports the tasks and workflows involved to build, ship and run container-based applications. The engine creates a server-side daemon process that hosts images, containers, networks and storage volumes. Docker Engine is a client-server based application.

- **Docker CLI** is a command line tool that lets you talk to the Docker daemon.

## VM VS Container
![Docker Vs VM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/usun26masw8vjuacfsoi.png)

**Containers** are an abstraction at the app layer that packages code and dependencies together. Multiple containers can run on the same machine and share the OS kernel with other containers, each running as isolated processes in user space. Container take up less space than VM's (Container images are typically tens of MB's in size), and start almost instantly.

**Virtual Machines(VM's)** are an abstraction of physical hard ware turning one server into many servers. The hypervisor allows multiple VM's to run on a single machine. Each VM includes a full copy of an Operating System, one or more apps, necessary binaries and libraries - taking up tens of GBs. VM can also be slow to boot.
 
##Basic Commands:
- Go to your favorite browser and Type docker over there click on download and Install docker on your favorite OS. So, I'm skipping these steps because it's a simple next, next wizard on Windows OS but if you having any difficulties installing docker on Linux OS or Mac OS go to the *[docs] 
 (https://docs.docker.com/engine/install/)* and explore how to do it. 
- After the installation process is completed window like this will appear to you.
![Docker Window](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/25l3tcl8gnwy2zuh1h6f.png)
- Now move towards terminal to run basic commands.
- *docker pull* pulls an image from registry to local machine.
![pull image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z9qi36w2p73we90ez7pc.PNG)
- *docker images* show images.

![images](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xoakzi3s7vp5c1he7q15.PNG)
- *docker run* both creates and runs a container in a single operation.
![run](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w20s1pa0845nroi99h0b.PNG)

- *docker ps* shows running containers.
![running container](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7c2fspmmlxf805rs72v1.PNG)
- *docker stop* stops a running container. 
![Stop container](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ozow2ty6nn3gvcixexq5.PNG)
- *docker ps -a* shows running as well as stopped containers.
![view stop container](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fhty4xtmph0bvs0ayb6b.PNG)
- *docker start* starts a container to run it.
![restart](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4tlv37vn7qviuabzhh7w.PNG)
##Conclusion

So you have learned about the basics of Docker, the difference between Virtual Machines and Docker Containers along with components of Docker.

In the next article, We'll try to create an application using Docker and pushed our images to Docker Hub. We'll explore more terminologies related to Docker Dockerfile, Docker Image, Docker Hub, Image repositories, Container Registries, and much more!!! 

If you want more content like this, you can follow me on [Twitter](https://twitter.com/zahoorlaiba1), where I tweet about webdevelopment, self-improvement, and my journey to exploring Cloud Native Technologies!
##What Next?
Here are my Next Steps for Learning Docker on YouTube:

- [TechWorld with Nana] (https://www.youtube.com/channel/UCdngmbVKX1Tgre699-XLlUA)
- [Bret Fisher] (https://www.youtube.com/channel/UC0NErq0RhP51iXx64ZmyVfg)
- [Nick Janetakis
] (https://www.youtube.com/channel/UCorzANoC3fX9VVefJHM5wtA)
- [Amigoscode] (https://www.youtube.com/user/djdjalas)
- [Aurélie Vache] (https://www.youtube.com/user/scraly) (YT)
- [Aurélie Vache] (https://dev.to/aurelievache) (Dev.to) 

##Video Link:
if you prefer to watch video then go and watch my YouTube video [My First Day of learning Docker] (https://youtu.be/3OLQDnH7A5M)