Docker Architecture

Docker Architecture

Docker follows client-server architecture, below are some important components:

  1. Docker Daemon

  2. Docker Host

  3. Docker Registry

  4. Docker Client

  5. Docker Images

  6. Docker Containers

Developers write docker files containing scripts of instructions that docker uses to create a container image. Let's see the docker components:

Docker Daemon

It runs on the host operating system and is responsible for running containers and managing the docker services. Docker Daemon also can communicate with other daemons as well.

Docker Client

It uses commands and REST APIs to communicate with the docker daemon. When the client runs docker commands on the docker client terminal, the client terminal sends these docker commands to the docker daemon. The Docker daemon receives these commands from the docker client in the form of commands and REST APIs request. Docker client uses cli to run some commands-

$ docker build <...>
$ docker run <...>
$ docker pull <...>

Docker Host

Docker Host is used to providing an environment to execute and run applications. It contains the docker daemon, images, containers, networks and storage.

Docker Registry

manages and stores docker images. There are two types of registries:

  • Public registry
  • Private registry

Docker Images

are the read-only binary template used to create docker containers

Docker Container

are the structural units of docker which are used to hold the entire package that is needed to run the entire application. In other words, we can say that an image is a template and the container is a copy of that template.

Docker Storage

is used to store data on the container. Docker offers the following options for storage:

  • Data volume: provides the ability to create persistance storage. It also allows naming the volumes, and containers associated with the volumes.

  • Directory Mounts: It is one of the best options for docker storage. It mounts a host's directory into a container.

  • Storage Plugins: These provide the ability to connect to external storage platforms.

In simple terms, Docker lets you package your applications and dependencies into images, which can then be run as containers on any host that has the Docker engine installed. This makes it easier to develop, test, and deploy applications, as everything runs in a consistent environment.