What exactly is Docker?

What exactly is Docker?

First we need to understand the problem statement:

To understand What is Docker, first we need to understand the problem statement. Docker solves a classic problem of development and deployment, like It works on my machine. Code works fine on developer machine but as soon as it is deployed, it doesn't works like it was expected. Then starts the blame game. Docker solves this issue. Not only this, docker helps in teaching code too.

What is Docker?

Docker is such a powerful and simple thing you'll ever know.

Docker is a containerized virtual environment that makes it easy to develop, maintain, and deploy apps and services.

Docker is a tool which is used to automate the deployment of the application in lightweight containers so that applications can work efficiently in different environments.

A container is a software package that consists of all the dependencies required to run an application.

Until now we have been running applications on virtual machines. Every virtual machine used to be the base of our application but now with the advent of Docker and containerization technologies each application is run in a container like logical space.

Benefits of using Docker

• Standardized application packaging

  • Same packaging for all types of applications

    • Like Java, Python, or JS

• Multi-platform support

  • Local machine

  • Datacenter

  • Cloud ( AWS, AZURE, and GCP )

• Lightweight & isolation

  • Containers are lightweight compared to VM's isolated from one another

What are Docker images?

Docker images are read only template that can be used to create containers out of it. These docker images contains all the dependencies for a particular application or any microservice. You can create your own image and upload that onto the DockerHub and at the same time you can also pull the images which are available in the public repositories.

How does a Docker image help?

• 1 Docker image is all you need to make

• Once you have a Docker image, it does not matter whether it's a Docker image of a Python application, Java application, or NodeJS application.

• You can run it the same way using the same instructions with Docker. And with Docker, you don't really need to follow a set of manual instructions. All that you need to do is execute a simple command, and your applications will be up and running.

NOTE :

• We should understand the fact that layers are cached.

• One of the important things that you'd need to remember is layers are cached.

• It's not only faster to build the image, but also it will be faster to push the image to the Docker hub.

• And also to pull the image onto wherever you want to deploy.

• So making sure that your layers are cached as much as possible is very very important.

Screenshot 2022-07-21 014411.png What is Docker Hub?

• Docker hub is a public registry, which is available at %[hub.docker.com ]

• Since Docker hub is a public registry, anybody can access it.

• A docker registry contains a lot of repositories - different versions of different applications.

• Typically, when we work in an enterprise, we use private repositories so that our application images are only accessed by people who have the right access to it.

Understanding Docker Architecture

docker_architecture_pull_run_powerpoint_presentation_mockup_slide01.jpg • Whenever we're installing Docker desktop on our machine we were actually installing two things.

• One is something called a Docker client and the other is something called a Docker daemon.

• So even the local installation of Docker uses something similar to a client-server architecture.

• Docker client is the client and the Docker daemon is like a server component.

• We run the commands in the Docker client and the Docker client sends them to Docker daemon for execution.

• So when we execute a command like Docker run the python image...What the Docker client does is, it just sends that command out to the Docker daemon.

• Docker daemon is the one who is really responsible for the execution of that specific command.

• The Docker daemon is responsible for a lot of things.

• It is responsible for managing your containers, managing your local images

• It is mainly responsible for pulling the image from the image repository

• The Docker daemon is also responsible for pushing those images out to the image repository.

That's it for today

• Thanks for reading and i would love to connect with you guys on Socials

• Any feedbacks are welcome!!

Did you find this article valuable?

Support Areeb Abdul Ghani by becoming a sponsor. Any amount is appreciated!