In this tutorial we will discuss about Docker architecture. I assume you have a basic understanding of Docker. If not, you may refer to the previous tutorial on Docker overview.
I believe you understand What is Docker and its importance in DevOps. Now behind this fantastic tool, there has to be an amazing, well-thought architecture. Isn’t it?
But before I talk about that, let me showcase the previous and current virtualization system.
Traditional vs New Generation Virtualization
Earlier, we used to create virtual machines, and each VM had its own Operating System which took a lot of space and made it heavy.
Now in docker container’s world, you have a single Operating System, and the resources are shared between the containers. Hence it is lightweight and boots in seconds.
Now let’s come to docker architecture. Docker follows Client-Server architecture, which includes the three main components that are Docker Client, Docker Host and Docker Registry.
Now we will discuss each components of a docker architecture.
1. Docker Client
- With the help of Docker Clients, users can interact with Docker.
- It is nothing but the method that users use to interact with Docker.
- When a client runs any docker command on the docker client terminal, the client terminal sends these docker commands to the Docker daemon.
- Docker client uses commands and REST APIs to communicate with the Docker Daemon (Server).
- It is possible for Docker client to communicate with more than one daemon.
2. Docker Host
- The Docker host provides a complete environment to execute and run applications.
- A Docker host is responsible for running the Docker daemon.
- Docker Daemon entertains API requests, including docker build and docker run amongst others.
- It also manages images, networks, containers, and other Docker objects.
- Daemons can communicate with each other to manage different Docker services.
- It can also communicate with other daemons to manage its services.
3. Docker Registry
- Docker Registry manages and stores the Docker images.
- There are two types of registries in the Docker
- Pubic Registry – Public Registry is also called as Docker hub.
- Private Registry – It is used to share images within the enterprise.
- Docker Hub is the default place of docker images, its stores’ public registry.
- When you execute docker pull or docker run commands, the required docker image is pulled from the configured registry.
- When you execute docker push command, the docker image is stored on the configured registry.