Skip to content

Docker Architecture

  • Docker uses a client-server architecture: the Docker CLI (client) sends commands to the Docker daemon (dockerd) which does the actual work - building images, running containers, managing networks and volumes.
  • Client and daemon communicate over a Unix socket (/var/run/docker.sock) by default, or over TCP for remote connections.
  • Docker Engine is the core open-source runtime. Linux-only. Includes:

    • dockerd — the daemon that manages container objects and exposes the Docker API
    • Docker CLI — the docker command-line client
    Terminal window
    # Connect CLI to a remote Docker daemon
    docker -H remote-host:2375 ps
    # Or set the environment variable
    export DOCKER_HOST=tcp://remote-host:2375
  • The daemon can join a cluster of other daemons (Docker Swarm) for orchestration.

  • Internally, dockerd delegates container execution to containerd, which uses runc (an OCI runtime) to actually create and run containers. This layered stack (dockerd → containerd → runc) is why OCI images built with Docker run on Kubernetes unchanged — Kubernetes uses containerd directly, skipping dockerd.

Docker Desktop is the developer-friendly distribution for macOS and Windows. It wraps Docker Engine in a Linux VM (via Apple Hypervisor / WSL2) and adds:

ComponentPurpose
CLIStandard docker commands
GUIManage images, containers, resource limits (CPU/memory/disk)
Credential HelperSecure credential storage for private registries
ExtensionsThird-party tools (e.g., Dive, Portainer, Trivy)
Optional KubernetesSingle-node K8s cluster alongside Docker

![Docker Desktop architecture](/images/virtualization/Docker Architecture.png)

Docker EngineDocker Desktop
OSLinux onlymacOS, Windows, Linux
LicenseFree (Apache 2.0)Free for personal use; paid for large orgs
KubernetesNot includedOptional, single-node
GUINoneIncluded
VM overheadNoneYes (Linux VM layer)
  • On Linux, prefer Docker Engine for servers and CI runners - no VM overhead, full performance.
  • On macOS/Windows, Docker Desktop is the practical choice. The VM boundary means bind mounts have some performance overhead compared to native Linux.
Terminal window
# The CLI is just a thin wrapper over the Docker REST API
# You can call it directly too:
curl --unix-socket /var/run/docker.sock http://localhost/containers/json
  • Any tool that speaks the Docker API (Portainer, VS Code Docker extension, CI runners) can manage Docker - the CLI is not special.