Architecture of Docker (original) (raw)

Last Updated : 23 Apr, 2026

Docker uses a client–server architecture. The Docker client talks to the Docker Daemon, which builds, runs, and manages containers. They communicate through a REST API via UNIX sockets or a network interface.

docker_host

Docker Architecture

The Core Architectural Model

This interaction forms a simple yet powerful loop: you use the Client to issue commands to the Daemon on the Host, which can pull images from a Registry to run as containers.

1. The Docker Daemon (dockerd):

The Docker Daemon is the persistent background process that acts as the brain of your Docker installation.

2. The Docker Client:

The Docker Client is the primary interface through which users interact with Docker. This is most commonly the Command Line Interface (CLI).

Common Commands:

3. The Docker Host

The Docker Host is the physical or virtual machine that provides the complete environment for executing and running containers. It comprises:

4. The Docker Registry

A Docker Registry is a stateless, scalable storage system for Docker images.

Image Lifecycle Commands:

Docker Objects

Whenever we are using a docker, we are creating and use images, containers, volumes, networks, and other objects. Now, we are going to discuss docker objects:-

1. Images

An image is a read-only, inert template that contains the instructions for creating a Docker container. Think of it as a blueprint or a class in object-oriented programming.

2. Containers

A container is a runnable, live instance of an image. If an image is the blueprint, a container is the house built from that blueprint.

3. Storage

Since a container's writable layer is ephemeral (data is lost when the container is deleted), Docker provides robust solutions for data persistence. Storage driver controls and manages the images and containers on our docker host.

Docker Storage

Docker Storage

Types of Docker Storage

Docker provides multiple storage options to persist, share, and manage data across containers and hosts.

Docker Networking

Docker networking provides complete isolation for docker containers. It means a user can link a docker container to many networks. It requires very less OS instances to run the workload.

Types of Docker Network

  1. **Bridge: It is the default network driver. We can use this when different containers communicate with the same docker host.
  2. **Host: When you don't need any isolation between the container and host then it is used.
  3. **Overlay: For communication with each other, it will enable the swarm services.
  4. **None: It disables all networking.
  5. **macvlan: Assigns a unique MAC address to a container, making it appear as a physical device on your network.

Step-by-Step Execution of a Docker Command

Let’s trace a common command to understand how all components work together:

client

End -to-End Command Execution flow

You run the command: docker run -d -p 80:80 nginx

  1. **Client: The Docker Client sends a REST API request to the Docker Daemon to create and run a container from the nginx image.
  2. **Daemon: The Daemon receives the request. It first checks if the nginx image exists locally on the Host.
  3. **Registry (Pull): If the image is not found locally, the Daemon contacts the configured Registry (Docker Hub by default) and pulls the nginx image.
  4. **Runtime (containerd): The Daemon passes the image and run-configuration over to containerd.
  5. **Runtime (runc): containerd uses runc to create a new container. runc interfaces with the Linux kernel to create isolated namespaces and limit resources with cgroups.
  6. **Execution: The container is started. Docker maps port 80 of the host to port 80 of the nginx container, as requested by the -p 80:80 flag. The Nginx process runs as PID 1 inside the container's isolated PID namespace.