Docker Architecture

Client, Daemon and Registry

  • The Docker client (docker CLI) sends your commands to the daemon through an API.
  • The Docker daemon (dockerd) builds images, runs containers and manages networks and volumes.
  • A registry stores images; docker pull downloads from it and docker push uploads to it.

What Happens on docker run

  1. The client sends "run nginx" to the daemon.
  2. The daemon looks for the nginx image locally; if missing, it pulls it from Docker Hub.
  3. It creates a container: a writable layer on top of the image, a network interface and an IP.
  4. It starts the container's main process (the image's CMD).
  5. The container runs until that main process exits.