runc, containerd, Docker, Podman and Kubernetes do not compete: they occupy three stacked layers. A low-level runtime runs an OCI bundle, an engine manages images, network and lifecycle before calling that runtime, and an orchestrator drives several machines. This lesson is for anyone who mixes up these names. You will see it by reading the process trees of a Debian 13 machine with Podman 5.4.2 and containerd 1.7.24, then you will place Docker, Kubernetes, Swarm, Nomad and Compose.
What you will learn
- Place a tool in its layer: low-level runtime, engine or orchestrator.
- Read a process tree to identify the daemon, the monitor and the runtime.
- Explain the role of the containerd shim and of Podman's conmon monitor.
- Replace Podman's runtime and check the change.
- Diagnose an empty
runc listor an emptyctr task ls.
Prerequisites
This lesson builds on Run an OCI bundle with runc,
which showed that a runtime reads a folder (the bundle) and starts a process.
You also know the kernel's namespaces
and cgroups, seen
in A container by hand and
Limit a container. The
commands in this lesson are tested as root on a disposable Debian 13 virtual
machine (kernel 6.12, cgroup v2). Install the packages with
apt install podman containerd runc crun jq. Name crun explicitly: on
Debian 13, podman does not install it, whereas the lesson uses it as the
runtime. Docker is not installed on this machine and the lesson does not need
it. No Kubernetes knowledge is required.
Why are runc, containerd, Docker and Kubernetes not competitors?
These tools stack: each one calls the one below it and delegates what it cannot do. The low-level runtime (runc, crun) does one thing only: turn an OCI bundle into an isolated process. The engine (containerd, CRI-O, Podman, Docker Engine, also called a "high-level runtime") fetches images, prepares storage and network, tracks the lifecycle, exposes an API, then calls the runtime. The orchestrator (Kubernetes, Swarm, Nomad) works across several machines: it keeps a desired state, schedules, restarts.
The diagram shows these layers and the chains this lesson runs. Follow the arrows from top to bottom: each one ends on the same kernel, through runc or crun. Kubernetes is greyed out because the lesson does not run it, and Docker is not in it: its chain has its own lesson, cited in the Docker Engine section.
The vocabulary changes from one source to another. The comparison page Container engines separates, within the engine layer, the complete engines (Docker, Podman), which build images and offer a complete command line, from the high-level runtimes for Kubernetes (containerd, CRI-O). Here, "runtime" always means the lowest level, the one that runs the bundle, and "engine" everything that calls it on a machine. To choose which one to install, read that comparison page. To place these layers against the hypervisor and serverless, see Execution platforms (in French).
Who really runs the container when you start Podman?
With Podman 5.4.2, the container is started by the crun 1.21 runtime, watched
by a small process called conmon, and no Podman daemon stays in memory.
A daemon is a service that runs permanently in the background and waits for
orders. The commands start from the reference Alpine image, pinned by its
digest, the fingerprint that designates that exact image. The following block
first asks Podman for its runtime, then starts a sleep 300 in the background
(-d). It then draws the processes as a tree (--forest) and finally looks
for a podman process that is still active:
IMG=docker.io/library/alpine:3.24.2@sha256:294b683cb724975bec92580e1e685676bd4b50bda910ddb8c51d4cabeaec77e6podman info --format '{{.Host.OCIRuntime.Name}} {{.Host.OCIRuntime.Path}} {{.Host.OCIRuntime.Version}}'podman run -d --name moteur-podman "$IMG" sleep 300ps -eo pid,ppid,comm,args --forest | grep -E "conmon|sleep 300" | grep -v greppgrep -a podman || echo "aucun processus podman résident"The first line of the answer is crun /usr/bin/crun crun version 1.21,
followed by a few lines of information about crun (commit, rundir, build
options). This result assumes the crun package is installed: without it,
Podman picks runc and the command answers runc.
A second query, podman info --format '{{.Host.CgroupsVersion}} {{.Host.CgroupManager}}',
answers v2 systemd: cgroups are version 2 and systemd manages them. Here is
the process tree, with the command line shortened. The first column is the PID
(process identifier), the second the PPID, the PID of its parent, that is, of
the process that started it:
6160 1 conmon /usr/bin/conmon --api-version 1 -c e0b63c80[…] -r /usr/bin/crun -b /var/lib/containers/storage/overlay-containers/e0b63c80[…]/userdata […] 6162 6160 \_ sleep \_ sleep 300aucun processus podman résidentThree facts can be read in these lines:
- The parent of
sleep 300is conmon, not Podman. conmon is a small monitor, one process per container, that watches the container. - conmon itself has process 1 as its parent: it detached from
podman. It is the one that stays to collect the container's exit code and keep its logs. - Its command line says what to run:
-r /usr/bin/crunnames the runtime to call and-b …/userdatagives the location of the bundle.
The podman command therefore finished its job as soon as the container
started: that is what "daemonless" means.
Does Podman build a real OCI bundle?
Yes: the folder passed to conmon contains an OCI config.json, the one the
runc lesson taught you to read. Podman writes it from the image and the
command, then hands it to the runtime. To read it, get the container's
identifier, then filter the file with jq, which extracts fields from a JSON
file:
ID=$(podman inspect -f '{{.Id}}' moteur-podman)jq '{args: .process.args, root: .root, hostname: .hostname, ns: [.linux.namespaces[].type]}' \ /var/lib/containers/storage/overlay-containers/$ID/userdata/config.jsonHere is what the command prints for this sleep 300, formatted over a few
lines and shortened (identifiers change at each launch):
{ "args": ["sleep", "300"], "root": { "path": "/var/lib/containers/storage/overlay/89de100e[…]/merged" }, "hostname": "3042b501398a", "ns": ["pid", "network", "ipc", "uts", "mount", "cgroup"]}The rootfs (root.path) is the merged folder of an overlay mount: the image
layers stacked by Podman. The hostname is the container's short identifier, and
the file asks for six namespaces.
The same container is visible on the runtime side, but not with the runc list
command alone. crun --root /run/crun list shows the full identifier, the
running state, the PID of the sleep (6162 here, varying from one launch to
the next) and the bundle path, whereas runc list shows only an empty
table: each runtime lists only the containers stored in its own state folder.
Can you change the runtime without changing the engine?
Yes: Podman's --runtime option replaces crun with runc, and the container is
identical from the application's point of view. Podman only changes what it
writes in the conmon line:
podman --runtime runc run -d --name moteur-runc "$IMG" sleep 300podman inspect -f '{{.OCIRuntime}}' moteur-runcps -eo args | grep conmon | grep moteur-runc | grep -oE " -r [^ ]+ -b"podman --runtime runc run --rm "$IMG" sh -c 'echo ok via runc; cat /etc/alpine-release'The second command should print runc, and the third extracts the fragment
-r /usr/bin/runc -b from the conmon line. The last one starts an ephemeral
container that prints ok via runc then 3.24.2 (the contents of
/etc/alpine-release). The engine and the runtime are two distinct things:
the first chooses the second.
Change Podman's default runtime
You want Podman to use runc for every container started afterwards, without typing --runtime each time. The setting goes in a configuration file. You then check what it changes for a container that is already running and for a new one. Run the commands as root, with the IMG variable defined above. If moteur-podman and moteur-runc, created above, are still running, they also appear in the lists of step 4: look only for exo-a and exo-b in them.
Start a first container with the default runtime
Read the runtime that Podman announces, then start a sleep 300 in the background under the name exo-a.
Write the configuration file
In /etc/containers/containers.conf.d/, create the file runtime.conf. It contains an [engine] section with the runtime key set to "runc". Then read the runtime announced by Podman again.
Start a second container with no option
Start a sleep 301 under the name exo-b, without --runtime, then read the recorded runtime for exo-a and for exo-b.
See which runtime started what
Look for exo-a and exo-b in the conmon lines. Then list the containers that crun and runc see in their state folder (/run/crun and /run/runc). These lists give hexadecimal identifiers, not names: podman ps --no-trunc shows each container's full identifier next to its name.
Go back
Delete the runtime.conf file and read the announced runtime again. Then delete exo-a and exo-b with podman rm -f -t 0. The -f option forces the removal of a running container. The -t 0 option removes the ten-second wait between the SIGTERM stop signal, which sleep ignores because it is PID 1 of the container, and the SIGKILL signal, which kills the process outright.
- podman info
- containers.conf
- podman inspect
- crun
- runc
A hint 1 / 2
The runtime of an existing container is read with podman inspect and a field whose name contains OCIRuntime. The runtime that Podman announces is read with podman info.
A hint 2 / 2
A container keeps the runtime it was started with. Look at what crun and runc each list.
I have tried: show the solution
podman info --format '{{.Host.OCIRuntime.Name}}'podman run -d --name exo-a "$IMG" sleep 300mkdir -p /etc/containers/containers.conf.dcat > /etc/containers/containers.conf.d/runtime.conf <<'CONF'[engine]runtime = "runc"CONFpodman info --format '{{.Host.OCIRuntime.Name}}'podman run -d --name exo-b "$IMG" sleep 301podman inspect -f '{{.OCIRuntime}}' exo-apodman inspect -f '{{.OCIRuntime}}' exo-bps -eo args | grep conmon | grep -v grep | grep -oE "exo-[ab]|-r [^ ]+ -b"crun --root /run/crun listrunc --root /run/runc listrm /etc/containers/containers.conf.d/runtime.confpodman info --format '{{.Host.OCIRuntime.Name}}'podman rm -f -t 0 exo-a exo-bBefore the file, podman info answers crun. After, it answers runc: the setting applies to the containers started afterwards. podman inspect gives crun for exo-a and runc for exo-b, and the conmon line of exo-a contains -r /usr/bin/crun -b whereas that of exo-b contains -r /usr/bin/runc -b. The two containers run side by side with two different runtimes.
Each runtime lists only the containers of its state folder: crun --root /run/crun list shows that of exo-a, and runc --root /run/runc list that of exo-b, each with that of moteur-podman (crun) or moteur-runc (runc) if it is still running. The runtime is chosen when the container starts and does not change afterwards: changing the configuration does not reach a container that already exists. Once the file is deleted, podman info answers crun again.
What does containerd do, and what is its shim for?
containerd is an engine: a daemon that keeps images and containers, but hands
each container to a separate process, the shim, which calls runc. With
containerd 1.7.24 and ctr, its command-line tool for diagnostics, four
commands are enough: pull the image, start a sleep 300 under the name
demo-ctr, list the running tasks, then print the process tree. The daemon must
be active (systemctl is-active containerd answers active):
ctr image pull "$IMG"ctr run -d "$IMG" demo-ctr sleep 300ctr task lsps -eo pid,ppid,comm,args --forest | grep -E "containerd|sleep 300" | grep -v grepThe pull writes many progress lines (resolving, downloading,
done for each layer, repeated at each refresh when the output is not a
terminal) before ending on unpacking linux/amd64 sha256:294b683c[…]
then done: followed by a duration. If containerd already has the blobs (the
image files), they show as exists instead of downloading.
Then ctr task ls shows demo-ctr as RUNNING with PID 6422 (varying from one
launch to the next). Here is the process tree, as an excerpt:
1996 1 containerd /usr/bin/containerd 6401 1 containerd-shim /usr/bin/containerd-shim-runc-v2 -namespace default -id demo-ctr -address /run/containerd/containerd.sock 6422 6401 \_ sleep \_ sleep 300The containerd daemon (PID 1996) stands alone: it has no parent-child link
with the container. The sleep has containerd-shim-runc-v2 as its parent, the
shim, which containerd started and then attached to process 1. The name
indicates the family of runtimes it can drive, runc, in version 2 of the shim
interface. It is the same idea as conmon in Podman: a small monitor per
container, placed between the daemon and the container.
The -namespace default in its command line designates a containerd
namespace, a scope that separates the objects of each client.
ctr namespaces ls lists them, and ctr task ls reads default unless you
pass -n.
Why does the container survive a containerd restart?
Because the shim, not the daemon, is the container's parent: restarting the daemon does not touch the shim's branch. To see it, restart the service and watch what becomes of the task and the process. The first command reads how systemd stops the unit:
systemctl show containerd -p KillModesystemctl restart containerdctr task lsps -eo pid,comm,args | grep "sleep 300" | grep -v grepAfter the restart, ctr task ls still shows demo-ctr as RUNNING
with the same PID 6422, and the sleep 300 is still there. The shim is designed
to keep the container alive, keep its input and output streams, and
wait for its end to pass the exit code to the daemon when the daemon
comes back.
This survival also assumes that the systemd unit does not kill the shims when
the daemon stops. On the unit provided by the Debian package, the first command
prints KillMode=process: only the daemon is stopped. You can therefore
restart containerd without cutting the running containers.
The containerd page (in French) details installation and configuration.
Have the containerd restart kill the container
You want to check that the container's survival really depends on the KillMode setting of the systemd unit, and not only on the shim. You will change this setting, restart containerd, see what becomes of a container, then return to the original state. With this setting, the restart kills all containerd containers, demo-ctr included: do this exercise on the disposable machine, after reading the section above. The image must have been pulled with ctr image pull "$IMG".
Start the test container
Start with ctr, in the background, a sleep 302 under the name exo-ctr, then read the unit's KillMode.
Change KillMode with a settings file
Create the folder /etc/systemd/system/containerd.service.d/ and, inside it, the file killmode.conf. It contains a [Service] section that sets KillMode to control-group. Have systemd reload its configuration, then read the KillMode.
Restart and look for the container
Restart containerd, wait two seconds, then list the tasks, look for the sleep 302 among the processes and count the containerd-shim processes.
Look at what remains on the containerd side
List the containers (not the tasks) known to containerd.
Go back and check
Delete the settings file and folder, have systemd reload the configuration, restart containerd and read the KillMode. Start exo-ctr2 (sleep 303), restart containerd again and check that the task survives. Finish by cleaning up exo-ctr and exo-ctr2.
- ctr
- systemctl
- ps
- drop-in systemd
A hint 1 / 2
The settings file goes in a folder whose name is that of the unit followed by .d. Without systemctl daemon-reload, systemd does not read it.
A hint 2 / 2
A container whose task is running is removed with ctr task kill, then ctr container rm. The cleanup in the lesson adds ctr task rm between the two, to remove the stopped task.
I have tried: show the solution
ctr run -d "$IMG" exo-ctr sleep 302systemctl show containerd -p KillModemkdir -p /etc/systemd/system/containerd.service.dcat > /etc/systemd/system/containerd.service.d/killmode.conf <<'CONF'[Service]KillMode=control-groupCONFsystemctl daemon-reloadsystemctl show containerd -p KillModesystemctl restart containerdsleep 2ctr task lsps -eo pid,comm,args | grep "sleep 302" | grep -v grepps -eo comm | grep -c containerd-shimctr container lsrm /etc/systemd/system/containerd.service.d/killmode.confrmdir /etc/systemd/system/containerd.service.dsystemctl daemon-reloadsystemctl restart containerdsystemctl show containerd -p KillModectr run -d "$IMG" exo-ctr2 sleep 303systemctl restart containerdctr task lsctr container rm exo-ctrctr task kill -s SIGKILL exo-ctr2ctr container rm exo-ctr2Before the file, KillMode=process. After, KillMode=control-group: when the service stops, systemd kills all the processes of the unit's group, shims and containers included. After the restart, ctr task ls shows only its header, the sleep 302 is gone, and the containerd-shim count is 0. However ctr container ls still lists exo-ctr: containerd keeps the container's description, but no task runs anymore.
After returning to KillMode=process, exo-ctr2 stays RUNNING with the same PID, before and after a restart. Survival comes from two things together: the shim, the container's parent, and a KillMode that leaves the shims alive. In this test, ctr task kill moves exo-ctr2's task to STOPPED, which then lets you delete the container.
Docker Engine: where does it fit?
Docker Engine is one more engine, which stacks its own daemons on the same chain: dockerd delegates to containerd, which hands each container to a shim, which calls runc. This lesson does not run it, because Docker is not installed yet at this point of the training. The lesson Who launches a container: Docker's execution chain, at level 4 of the Docker training, reuses the same process-tree commands on a machine where Docker runs.
Do Podman and containerd share their images?
No: each engine has its own image storage, even if it handles the same OCI image. Podman had already pulled the image, but ctr image pull had to pull it again and unpack it (unpacking linux/amd64 …). podman images and ctr image ls therefore do not list the same thing: one engine does not see another's images. The digest, for its part, stays identical from one engine to the other, which shows that the image is the same. To compare two images, compare their digest rather than their name.
How do you clean up this lesson's containers?
Each engine removes its own containers: you therefore need two sets of
commands. In the container, sleep is process 1 and ignores the SIGTERM stop
signal, so podman rm -f waits ten seconds before sending SIGKILL, which kills
the process without giving it a choice. The -t 0 option removes this wait.
podman rm -f -t 0 moteur-podman moteur-runcctr task kill -s KILL demo-ctrctr task rm demo-ctrctr container rm demo-ctrTo check, podman ps -a, ctr task ls and ctr container ls should
show empty tables, and ps -eo pid,args | grep "sleep 300" should find
nothing. The warning
task demo-ctr exit with non-zero exit code 137 printed by ctr is normal:
137 is the exit code of a process killed by SIGKILL.
If you did exercise 2, containerd has already lost the task of demo-ctr:
only ctr container rm demo-ctr is useful, and the warning above does not
appear. If you stopped an exercise before its return to the original state,
also check that its settings files are gone with
ls /etc/containers/containers.conf.d/runtime.conf /etc/systemd/system/containerd.service.d/killmode.conf:
the command should answer No such file or directory twice. Otherwise,
delete the file or files present, then run systemctl daemon-reload and
systemctl restart containerd. systemctl show containerd -p KillMode should
then answer KillMode=process.
How do you read "who calls whom" at a glance?
For each tool, a single question is enough: what is the parent of the container's process? If it is a shim or conmon, you have found the monitor, and its command line names the runtime. The table gathers what this lesson's tests showed.
| Tool | Resident daemon? | Monitor or shim | OCI runtime | Kernel |
|---|---|---|---|---|
| Podman 5.4.2 | no | conmon 2.1.12 | crun 1.21 (or runc) | namespaces, cgroups v2 |
containerd 1.7.24 (ctr) | containerd | containerd-shim-runc-v2 | runc 1.1.15 | namespaces, cgroups v2 |
| Kubernetes (not run in this lesson) | kubelet on each node, then the engine's daemon | the engine's | the engine's, runc in general | namespaces, cgroups |
The last row does not come from a test: this lesson does not run Kubernetes. Its description relies on the site pages cited in the next section.
And the orchestrator, what does it add?
An orchestrator runs no container itself: it decides on which machine a
container must run, checks that it still runs, and asks the local engine to
restart it. In Kubernetes, the kubelet of each node receives the list of
Pods to run and talks to the engine through the CRI
(Container Runtime Interface, a gRPC API). That engine is containerd or CRI-O,
and it is the one that calls runc as in the tests above. This lesson does not
run that chain: the pages
CNI, CSI and CRI,
Worker nodes and
crictl (in French) detail it, and crictl lets you
observe it on a node.
The table places the other tools cited with their layer, what they do and what they delegate. Compose is also in it, though it is not an orchestrator.
| Layer | Examples | What it does | What it delegates |
|---|---|---|---|
| Orchestrator | Kubernetes, Docker Swarm (in French), Nomad (in French) | several machines, desired state, scheduling, restart | execution to each node's engine (CRI for Kubernetes) |
| Multi-container description | Docker Compose | describes several containers in YAML on a single host | everything else to that host's engine |
| Engine | containerd, CRI-O, Podman, Docker Engine | images, storage, network, lifecycle, API | execution to the OCI runtime |
| Low-level runtime | runc, crun | runs a bundle | nothing: it talks to the kernel |
Compose reads a file and creates containers on a single machine: it does not choose a machine and does not reschedule the containers elsewhere if the host goes down. Docker's Swarm mode and Nomad, for their part, work on a fleet of machines; their page describes how each one drives its engine. Nomad uses task drivers (including Docker and Podman) and can also run workloads that are not containers.
To know which one to use, first look at the size of the fleet. The table gives a starting point; the choice of engine is covered in the comparison page cited above.
| Situation | Tool to look at |
|---|---|
| Local development, a few containers on your workstation | Docker Compose |
| A single machine, several services | Compose, or Docker's Swarm mode |
| A few machines | Docker Swarm (in French) or Nomad (in French) |
| Cloud-native production, large fleet | Kubernetes |
| Edge, IoT, homelab (limited resources) | K3s (in French), a lightweight Kubernetes distribution |
There remains another family: LXC and Incus first create system containers, with a full operating system. They rely on the liblxc library rather than on an OCI runtime like runc; the comparison with Docker and Podman is in Container engines.
Troubleshooting
In every case, start from the process tree, the one drawn by
ps -eo pid,ppid,comm,args --forest: it says who started whom.
| Symptom | Cause | Solution |
|---|---|---|
| You do not know which runtime your engine uses | Each engine has its default runtime | Podman: podman info --format '{{.Host.OCIRuntime.Name}}' answers crun. containerd: the shim name in the process tree, containerd-shim-runc-v2, designates runc |
runc list is empty while containers are running | Each engine has its own state root: runc looks at /run/runc by default | Give the engine's root: runc --root /run/containerd/runc/default list for containerd, crun --root /run/crun list for Podman |
The container still runs after systemctl restart containerd | The shim is the container's parent, not the daemon | Normal behavior; to stop it, ctr task kill -s KILL demo-ctr, ctr task rm demo-ctr then ctr container rm demo-ctr |
ctr task ls is empty while a container is running | ctr reads the containerd namespace default; another client stores its tasks elsewhere (Docker uses moby) | ctr namespaces ls, then ctr -n <namespace> task ls |
| The image pulled with Podman is not found in containerd | Separate image storage | Pull the image with the engine you want, by its digest |
Put it into practice
The lab runs on a Debian 13 without Docker, where Podman, conmon, crun, runc and containerd are installed. You start a Podman container handed to runc rather than crun, then a containerd task in a separate containerd namespace. A container announced by a colleague does not appear in ctr task ls: it is up to you to find it and name the shim that watches it, then the conmon of your Podman container. The validation checks the state of both engines and compares the PIDs you note with the real processes.
Key points
- Three layers: low-level runtime (runs a bundle), engine (images, network, lifecycle, API) and orchestrator (several machines).
- Each layer delegates to the one below: the process tree shows it for Podman and containerd.
- Podman has no resident daemon: conmon watches the container and calls
crun, or runc with
--runtime runc. - containerd is a daemon; its shim stays the container's parent, which
therefore survives the daemon's restart, as long as the systemd unit does not
kill the shims (
KillMode=process). - Docker Engine stacks
dockerdoncontainerd: its chain is described in the level 4 lesson. - Each engine has its image storage and its state root: an empty
runc listproves nothing. - Compose describes containers on one host; Kubernetes, Swarm and Nomad orchestrate a fleet, Kubernetes talking to the engine through the CRI.
Knowledge check
Six questions drawn from twelve check that you place each tool in its layer and that you can read a process tree.
Knowledge check
Check what you have learned with this interactive quiz
How it works
- The timer starts when you click Start
- Multiple choice, true/false and short answer questions
- You can move between questions
- Detailed results are shown at the end
Starts the quiz and the timer
Review
(0/0)Result saved on this device. It will be sent to your account at the next sync. Sync now
Score by domain
A domain groups several guides and gets several questions, so its score is more reliable than a per-topic score, which often rests on a single question.
Summary
Strengths
No topic passed at 80% on at least two questions yet.
Weak areas
No topic below the pass mark.
Recommended next
Hints before you try again?
Continue the course: Choosing a container engine: Docker, Podman, LXC
A new full quiz with random questions
Work again only on the questions you missed