/    /  Docker – Architecture

Docker Architecture

 

Docker has a Client-Server architecture, which includes three main components: Docker Client, Docker Host, and Docker Registry.

docker

Docker daemon

The Docker daemon runs on the host operating system and runs containers to manage Docker services. It communicates with other daemons and provides various Docker objects like images, containers, networking, and storage.

  1. Docker Client

Docker client communicates with Docker Daemon (Server) using commands and REST APIs. Docker commands are sent to the Docker daemon by the client terminal when run on the Docker client terminal. The Docker daemon gets these commands from the client as commands and REST APIs.

Note: The Docker Client can communicate with multiple Docker daemons.

Docker Client uses a Command Line Interface (CLI) to run these commands:

  • docker build
  • docker pull
  • docker run
  1. Docker Host

The Docker Host provides an environment for running apps, including the Docker daemon, images, containers, networks, and storage.

  1. Docker Registry

The Docker Registry manages and stores Docker images.

Docker has two types of registries:

Pubic Registry – Also known as Docker hub.

Private Registry – For sharing images within an organization.

Docker Objects

Docker Objects include:

Docker Images

The Docker images are read-only binary templates for creating Docker Containers. A private container registry is used to share container images within an organization, and a public container registry is used to share container images with everyone else. In docket images, metadata describes the container’s capabilities too.

Docker Containers

In Docker, containers are used to store the entire package that is needed to run an application. Containers require very little resources.

We can say that the image is a template, and the container is a copy.

a2

Docker Networking

A Docker package can be communicated using Docker Networking, which includes the following network drivers:

Bridge – Bridge is the default network driver for containers. It’s used when multiple containers talk to the same host.

Host – We use it when we don’t need network isolation between containers and hosts.

None – All networking is disabled.

Overlay – Swarm services can communicate with each other through overlay. Containers can run on different Docker hosts.

Macvlan – When we want to assign MAC addresses to containers, we use macvlan.

Docker Storage

Data is stored on containers using Docker Storage. Docker offers the following options:

Data Volume – Besides creating persistence storage, Data Volume lets you name volumes, list volumes, and associate containers with them.

Directory Mounts – One of the best options for docker storage. Mounts a host’s directory into a container.

Storage Plugins – External storage platforms can be connected.