Skip to content
atlas

Container runtime

The software on each host that actually starts, stops and walls off containers - containerd is a well-known example.

Draft - this entry has not been reviewed yet.

Formal

The program that takes a container image, unpacks it and asks the kernel to start a process with its own view of files, network and other processes plus limits on memory and processor use; higher-level tools such as Docker and Kubernetes hand this work to it.

In plain English

Like the engine room of a ship - the captain gives the orders, but this is where the machinery actually turns them into movement.

In practice

When Kubernetes places a pod on a machine in a hospital region's data centre, the agent there asks containerd to fetch the image and start it, and containerd calls a smaller helper tool that sets up the walls in the kernel.

Why it matters

The runtime is the part that holds each container apart from the host, so a flaw in it can let code break out of every container on that machine at once.

Technical deep dive

"Container runtime" names two layers that are easy to confuse. A low-level (OCI) runtime implements the OCI Runtime Specification: given a bundle - a root filesystem plus config.json - it performs the create, start, kill and delete operations by calling clone/unshare for namespaces, writing cgroup limits, pivoting into the root filesystem, dropping capabilities, installing the seccomp filter and applying the AppArmor or SELinux profile before exec'ing the entrypoint. runc (written in Go, originally Docker's libcontainer donated to the OCI in 2015) is the reference implementation; crun (C) and youki (Rust) are faster or smaller alternatives. A high-level runtime such as containerd or CRI-O manages everything around that: pulling and unpacking images into snapshots, preparing the bundle, attaching networking via CNI plugins, streaming logs and exec sessions, and supervising each container through a small shim process so that the container survives a restart of the daemon.

Kubernetes talks to the high-level runtime over the Container Runtime Interface (CRI), a gRPC API with a RuntimeService (pod sandboxes and containers) and an ImageService, introduced in Kubernetes 1.5. Docker Engine never implemented CRI itself; the kubelet's built-in adapter, dockershim, was removed in Kubernetes 1.24, after which clusters use containerd or CRI-O directly (images built by Docker still run unchanged because they are OCI images). The call chain on a node is therefore kubelet → CRI → containerd or CRI-O → shim → runc → kernel.

Sandboxed runtimes plug into the same interface but change the isolation model. gVisor's runsc intercepts system calls in a user-space kernel (the Sentry) so the workload touches only a narrow slice of the host kernel; Kata Containers boots each pod in a lightweight VM with its own guest kernel under a hypervisor such as QEMU or Cloud Hypervisor. Kubernetes selects between handlers per pod with a RuntimeClass object, so one cluster can run trusted workloads on runc and untrusted ones on gVisor or Kata at the cost of some performance and compatibility.

The runtime is part of the trusted computing base: it runs as root on the host and parses attacker-influenced input (image layers, config, exec requests). runc CVE-2019-5736 and CVE-2024-21626 both became host-level escapes, which is why runtime patching belongs in routine vulnerability management alongside kernel patching. Hardening options include rootless mode, enabling user namespaces for pods, restricting access to the runtime socket (/run/containerd/containerd.sock) and default seccomp profiles. Unlike the orchestrator, the runtime has no notion of desired state across the cluster; it only does what its local agent asks.

What to learn first

Everything this builds on, foundations first.

  1. File system
  2. →Kernel
  3. →Operating system
  4. →Process
  5. →Container
  6. →Container image
  7. →Container runtime

Relationships

Sources & further reading

Official documentation

Where this data comes from

This entry was drafted by an AI from the sources above and has not yet been checked by a person. Treat it as a starting point, and check anything important against the sources.

See the review queueSuggest a correction on GitHubThis term as JSON

Check yourself

Loading…

Atlas is in beta.