Labs ICT
โญ Pro Login

Docker Architecture

Client, daemon, images, and containers

How Docker Works

Docker uses a client-server architecture with three main components.

The Three Components


  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚    Docker Client     โ”‚  โ† You (docker CLI)
  โ”‚  docker run, build   โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
             โ”‚ REST API
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚   Docker Daemon      โ”‚  โ† dockerd (background service)
  โ”‚  Builds, runs,       โ”‚
  โ”‚  manages containers  โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
             โ”‚
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚   containerd +       โ”‚  โ† Low-level container runtime
  โ”‚   runc               โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Concepts

  • Image โ€” A read-only template with instructions for creating a container. Think of it as a blueprint.
  • Container โ€” A running instance of an image. You can create many containers from one image.
  • Registry โ€” A storage for images. Docker Hub is the default public registry.
  • Dockerfile โ€” A text file with step-by-step instructions to build an image.

Data Flow


  1. You write a Dockerfile
  2. docker build โ†’ Docker daemon builds an image
  3. docker run โ†’ Docker daemon creates a container from that image
  4. Container runs your app in isolation
  5. docker push โ†’ Share image to a registry
  6. Someone pulls your image and runs it

  Dockerfile โ†’ Image โ†’ Container โ†’ Running App

๐Ÿงช Quick Quiz

What is the Docker daemon?