What Is a Container Runtime?
“Container runtime” means different things depending on who you ask. Some people mean Docker, some mean containerd, and some mean a small binary called runc that most administrators never run by hand. All three are correct, because they work at different layers of the same stack. Most confusion about runtimes comes from mixing those layers up.
A container is not a virtual machine. It is a normal Linux process that the kernel isolates with namespaces (what the process can see), limits with cgroups (what it can use), and locks down with seccomp, capabilities and SELinux/AppArmor (what it is allowed to do). A runtime sets up those kernel features, starts the process inside them, and cleans up when it exits. The tools differ in how much they do on top of that: pulling images, managing storage and networking, serving an API, or answering to Kubernetes.
This snippet covers how the pieces fit together, when to use each one, and what to keep in mind when you look after them on a real server.
The Layers: Low-Level vs High-Level Runtimes
The easiest way to keep this straight is to split runtimes into two groups.
Low-level runtimes (OCI runtimes) do one job: take an unpacked filesystem (a bundle) and a config.json, then create the namespaces and cgroups and start the process. They follow the OCI Runtime Specification, so they can be swapped for each other. They do not pull images, manage networks or keep state for long.
High-level runtimes (container managers) do everything else: pull and store images, unpack layers, set up networking and volumes, track container state, provide an API or CLI, and call a low-level runtime to start each container.
A typical Docker host looks like this:
docker CLI
│ (REST API over /var/run/docker.sock)
▼
dockerd ──────────────► networking, volumes, builds, compose
│ (gRPC)
▼
containerd ───────────► images, snapshots, container lifecycle
│
▼
containerd-shim-runc-v2 (one per container, keeps it running if containerd restarts)
│
▼
runc ─────────────────► namespaces + cgroups + seccomp → your process
A Kubernetes node skips Docker completely:
kubelet ──(CRI gRPC)──► containerd or CRI-O ──► runc / crun ──► your process
The Runtimes at a Glance
| Runtime | Layer | What it is | Typical home |
|---|---|---|---|
Docker Engine (dockerd) |
High-level platform | A full container platform: CLI, REST API, image builds (BuildKit), networking, volumes and Compose. Uses containerd and runc underneath. | Developer workstations, single hosts, CI runners, small production servers. |
| containerd | High-level runtime | A CNCF graduated daemon that manages images, storage snapshots and container lifecycle. Has a built-in CRI plugin for Kubernetes. Deliberately minimal and not meant as a daily-use CLI. | Kubernetes nodes (EKS, GKE, AKS, k3s, kind and most kubeadm clusters), and underneath every Docker install. |
| CRI-O | High-level runtime | A lightweight runtime built only to serve the Kubernetes CRI. Its versions follow Kubernetes minor releases. It does nothing outside Kubernetes. | OpenShift, and kubeadm clusters on RHEL/Fedora-family systems. |
| Podman | High-level tool (daemonless) | A Docker-compatible CLI with no central daemon. Each container is a child of the process that started it (via conmon). Rootless by default for normal users, supports pods, and integrates with systemd through Quadlet. |
RHEL, Fedora and other systems where you want containers managed like systemd services, or rootless containers for unprivileged users. |
| runc | Low-level (OCI) | The reference OCI runtime, written in Go. Used by default by Docker and containerd. | Almost everywhere. |
| crun | Low-level (OCI) | An OCI runtime written in C. Faster startup and lower memory use than runc. | Default for Podman and CRI-O on Fedora/RHEL. |
gVisor (runsc) |
Low-level (sandboxed) | Intercepts system calls in a user-space kernel, so the container never talks to the host kernel directly. Stronger isolation, with some performance and compatibility cost. | Running untrusted or multi-tenant workloads. |
| Kata Containers | Low-level (sandboxed) | Runs each container (or pod) inside a lightweight VM with its own kernel. Gives VM-level isolation with a container workflow. | Multi-tenant platforms, compliance-sensitive workloads. |
Docker vs containerd
This is the comparison people ask about most, and the honest answer is that they are not competitors. Docker uses containerd. When you install Docker Engine you are also installing containerd, and systemctl status containerd will show it running.
The real question is whether you need the extra layer Docker adds.
| You want to… | Use |
|---|---|
| Build images, run Compose stacks, and work on a single host or laptop | Docker (or Podman) |
| Run a Kubernetes node | containerd or CRI-O directly. Docker adds nothing for the kubelet. |
| Run containers as systemd services without a daemon, or run rootless by default | Podman |
| Embed a runtime in your own platform or tool | containerd through its Go client or gRPC API |
Docker vs Podman
Podman was designed as a drop-in replacement for the Docker CLI, and for most commands alias docker=podman just works. The differences show up in how it runs.
| Docker | Podman | |
|---|---|---|
| Daemon | dockerd runs as root and owns every container. If it stops, management stops (containers survive only if live-restore is enabled). |
No daemon. Each container runs under its own conmon monitor process. |
| Rootless | Supported, but you have to set it up separately (dockerd-rootless-setuptool.sh). |
Default when a normal user runs it. |
| systemd integration | Containers are managed by the daemon’s restart policies. | Quadlet .container files in /etc/containers/systemd/ (or ~/.config/containers/systemd/) become real systemd units. |
| Pods | No native pod concept. | Native pods (shared network namespace), and podman kube play can run Kubernetes YAML. |
| Compose | docker compose (built in). |
podman compose, which calls an external compose provider. Most files work, but edge cases differ. |
| Image storage | /var/lib/docker (or the containerd store). |
/var/lib/containers/storage for root, ~/.local/share/containers/storage for each user. |
Choosing the Right Runtime
| Scenario | Recommendation |
|---|---|
| Single web server running a few services | Docker with Compose, or Podman with Quadlet if you prefer native systemd management. |
| RHEL / Fedora / Rocky / Alma host | Podman is the vendor-supported tool and ships with the OS. Docker works but comes from a third-party repository. |
| Kubernetes worker or control-plane node | containerd (most distributions and managed services) or CRI-O (OpenShift, many RHEL-based clusters). |
| CI runners building images | Docker with BuildKit, or rootless Podman/Buildah if runners must not have root. |
| Running untrusted code (customer workloads, sandboxes) | containerd or CRI-O with gVisor or Kata Containers set up as a separate runtime class. |
| Hardened or compliance-heavy environments | Rootless Podman, or a Kubernetes runtime with SELinux enforcing and a restricted seccomp profile. Check your applicable STIG or CIS benchmark. |
Day-to-Day Commands by Tool
Each layer has its own CLI, and they do not see each other’s work the way you might expect.
| Task | Docker | Podman | containerd (nerdctl) |
Kubernetes node (crictl) |
|---|---|---|---|---|
| List running containers | docker ps |
podman ps |
nerdctl ps |
crictl ps |
| List images | docker images |
podman images |
nerdctl images |
crictl images |
| View logs | docker logs -f web |
podman logs -f web |
nerdctl logs -f web |
crictl logs -f <id> |
| Shell into a container | docker exec -it web sh |
podman exec -it web sh |
nerdctl exec -it web sh |
crictl exec -it <id> sh |
| Inspect configuration | docker inspect web |
podman inspect web |
nerdctl inspect web |
crictl inspect <id> |
| Live resource usage | docker stats |
podman stats |
nerdctl stats |
crictl stats |
| Remove unused data | docker system prune |
podman system prune |
nerdctl system prune |
crictl rmi --prune |
| Runtime and storage info | docker info |
podman info |
nerdctl info |
crictl info |
containerd Namespaces
containerd separates clients into its own namespaces (not Linux namespaces). Docker uses moby, Kubernetes uses k8s.io, and nerdctl and ctr use default. If you run ctr images ls on a Kubernetes node and see nothing, you are looking in the wrong namespace.
# List containerd namespaces
sudo ctr namespaces ls
# Images the kubelet pulled
sudo ctr -n k8s.io images ls
# Same thing with nerdctl
sudo nerdctl --namespace k8s.io ps -a
Point crictl at the Right Socket
crictl talks to whatever CRI endpoint you give it. Set it once in /etc/crictl.yaml so you don’t have to pass it every time.
# /etc/crictl.yaml - containerd
runtime-endpoint: unix:///run/containerd/containerd.sock
image-endpoint: unix:///run/containerd/containerd.sock
timeout: 10
# For CRI-O use:
# runtime-endpoint: unix:///var/run/crio/crio.sock
Find Out What a Host Is Actually Running
# Which runtime daemons are active?
systemctl is-active docker containerd crio podman.socket 2>/dev/null
# On a Kubernetes cluster, the runtime and version for every node
kubectl get nodes -o wide # see the CONTAINER-RUNTIME column
# Which OCI runtime Docker uses by default
docker info --format '{{.DefaultRuntime}}'
# Which OCI runtime Podman uses
podman info --format '{{.Host.OCIRuntime.Name}}'
# Low-level runtime versions
runc --version
crun --version
Important Things to Keep in Mind
Access to the Socket Means Root
Anyone who can write to /var/run/docker.sock (or the containerd and CRI-O sockets) can start a privileged container that mounts the host’s root filesystem. Adding a user to the docker group is effectively giving them root. Treat that group like wheel, and never mount the socket into a container unless you understand the risk, for example with CI agents or “management” dashboards.
# Who can control Docker?
getent group docker
ls -l /var/run/docker.sock
If users need to run containers without root, use rootless Podman or rootless Docker instead.
Don’t Mix Runtimes on a Kubernetes Node
Installing Docker on a node that already uses containerd for the kubelet is common and usually harmless, because Docker uses its own moby namespace. But it does mean two sets of images on disk, two sets of iptables/nftables rules, and confusion about which tool shows which containers. On dedicated nodes, run only the CRI runtime and use crictl for troubleshooting.
Match the cgroup Driver
On systemd-based hosts, the kubelet and the container runtime must use the same cgroup driver, which should be systemd. A mismatch causes unstable nodes and pods being killed for no obvious reason.
# /etc/containerd/config.toml (containerd 2.x, config version 3)
[plugins.'io.containerd.cri.v1.runtime'.containerd.runtimes.runc.options]
SystemdCgroup = true
Also check that the host uses cgroup v2 (the default on current distributions), since newer Kubernetes and runtime releases are dropping cgroup v1 support:
stat -fc %T /sys/fs/cgroup # "cgroup2fs" means cgroup v2
Disk Space Disappears Quietly
Images, stopped containers, build cache and container logs all pile up. On Docker, the default json-file log driver has no size limit, so one chatty container can fill /var.
# Where is the space going?
docker system df -v
podman system df
# Set log limits for all new containers in /etc/docker/daemon.json
{
"log-driver": "json-file",
"log-opts": { "max-size": "10m", "max-file": "3" }
}
Changes to daemon.json apply only to containers created after a systemctl restart docker. Existing containers keep their old log settings until you recreate them. On Kubernetes nodes the kubelet handles log rotation (containerLogMaxSize) and image garbage collection, but its thresholds still need to fit your disk.
Restarting the Daemon Is Not Always Safe
- Docker: restarting
dockerdstops every container unless"live-restore": trueis set indaemon.json. - containerd and CRI-O: containers keep running during a restart because each one has its own shim (
containerd-shim-runc-v2orconmon). - Podman: there is no daemon to restart. Upgrading Podman doesn’t touch running containers, but they keep using the old binaries until you restart them.
Plan runtime upgrades like kernel upgrades: drain the node (kubectl drain) or schedule a maintenance window.
Containers and the Host Firewall
Docker writes its own iptables/nftables rules, and published ports (-p 8080:80) skip the host’s INPUT chain. That means a firewalld or UFW rule that “blocks” port 8080 may not actually block it. Bind published ports to localhost when only a reverse proxy needs them, and put your own filtering rules in the DOCKER-USER chain.
# Only reachable from the host itself
docker run -d -p 127.0.0.1:8080:80 nginx
Podman (with netavark) and Kubernetes CNI plugins also manage their own rules. Always test exposure from a second machine instead of trusting the local firewall configuration.
Keep the Low-Level Runtime Patched
Some of the most serious container escapes have been in the OCI runtime itself, for example CVE-2019-5736 and CVE-2024-21626 (“Leaky Vessels”), both in runc. Your distribution’s runc, crun and containerd packages are as important to patch as the kernel. When Docker is installed from Docker’s own repository, containerd.io (which includes runc) is a separate package, so make sure your update process covers it.
# RHEL / Fedora family
sudo dnf list --installed | grep -E 'containerd|runc|crun|podman|docker|cri-o'
# Debian / Ubuntu
dpkg -l | grep -E 'containerd|runc|crun|podman|docker|cri-o'
Leave SELinux and AppArmor Turned On
On RHEL-family hosts, bind mounts often fail with “permission denied” until you relabel them. The fix is the :Z (private) or :z (shared) volume option, not setenforce 0.
podman run -v /srv/site:/usr/share/nginx/html:Z nginx
Check ausearch -m avc -ts recent or journalctl -t setroubleshoot when a container is blocked, and avoid --privileged unless the workload truly needs it.
Logs Live in Different Places
| Runtime | Where to look |
|---|---|
| Docker daemon | journalctl -u docker |
| Docker containers | docker logs <name>, files under /var/lib/docker/containers/<id>/ |
| containerd | journalctl -u containerd |
| CRI-O | journalctl -u crio |
| Kubernetes pods | kubectl logs, or /var/log/pods/ and /var/log/containers/ on the node |
| Podman (Quadlet / systemd) | journalctl -u <unit> or journalctl --user -u <unit> for rootless |
If you set Docker’s log driver to journald, container output shows up alongside everything else and you can filter it with journalctl CONTAINER_NAME=web. My journald snippet covers those filters in more detail.
Closing Notes
The short version: runc (or crun) runs the container, containerd or CRI-O manages it, and Docker or Podman is the tool you type commands into. Kubernetes talks to the middle layer through the CRI and has no use for Docker itself. Because all of them share the OCI image and runtime specs, picking one is about operations, not compatibility. Ask yourself whether you need a daemon, whether you need rootless, how the tool fits with systemd, and what your platform vendor supports.
Whichever you choose, the day-to-day work is the same. Lock down the socket, cap logs and disk usage, keep the cgroup driver consistent, patch the low-level runtime, and leave SELinux or AppArmor enforcing.
Where to go next
If you want to put containerd to work in a real cluster, my Kubernetes Basics course walks you through building a multi-node cluster on your own Linux machine with kind, then deploying, scaling, debugging and rolling back real workloads. It is available on my LMS here.