Docker & Containers (50 Qs)•Part 3: Advanced Internals, Scale & Production Security (Senior / Lead)
Container Runtime Architecture: What is the relationship between Docker CLI, Dockerd, Containerd, runc, and OCI?
senior LevelMost AskedCode ExampleCLISecurity & AuthDocker & Containers
In Simple Words: Modern container infrastructure is decoupled into layered, open-standard components governed by the Open Container Initiative (OCI):
scss
[ docker CLI / kubectl ]
| (gRPC / HTTP)
v
[ dockerd / kubelet ] (High-level daemon: builds, volumes, networks)
| (CRI / gRPC)
v
[ containerd ] (Container supervisor: image pull, unpack, snapshot management)
| (shim-v2)
v
[ runc ] (Low-level OCI reference runtime: executes Linux clone(), unshare(), setns())
|
v
[ Linux Kernel ] (Namespaces, cgroups, LSM, capabilities)
- OCI Specifications: Standardizes image format (Image Spec) and runtime execution (Runtime Spec).
runc: A lightweight CLI tool that takes an unpacked rootfs directory and aconfig.jsonspecification, invokes kernel syscalls, and exits once the container process starts.containerd: Manages the full container lifecycle, image transfers, content storage, and spawnscontainerd-shimper container so the container stays running even ifdockerdrestarts.