Skip to content
Français
Sync not enabled: your progress stays in this browser My learning
Select theme
Français

Runtime, engine, orchestrator: who does what?

By updated

Improve this page

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 list or an empty ctr 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.

Four stacked layers: orchestrator (Kubernetes), engine (Podman, containerd), OCI runtime (runc, crun) and Linux kernel. Kubernetes calls containerd through the CRI, containerd calls runc through a shim, Podman calls crun through conmon, or runc with --runtime runc.Kubernetesnot replayed herecontainerd CRI runc shim Podman --runtime runc crun conmon Isolated andlimited processOrchestratorEngineOCI runtimeLinux kernelComponentEntryApplicationControlFlow
Each arrow reads 'calls'. Podman can also call runc with the --runtime runc option (dotted line). Source · SVG
Esc to close, + and − to zoom, scroll to move around. 100 %

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:

Terminal window
IMG=docker.io/library/alpine:3.24.2@sha256:294b683cb724975bec92580e1e685676bd4b50bda910ddb8c51d4cabeaec77e6
podman info --format '{{.Host.OCIRuntime.Name}} {{.Host.OCIRuntime.Path}} {{.Host.OCIRuntime.Version}}'
podman run -d --name moteur-podman "$IMG" sleep 300
ps -eo pid,ppid,comm,args --forest | grep -E "conmon|sleep 300" | grep -v grep
pgrep -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 300
aucun processus podman résident

Three facts can be read in these lines:

  • The parent of sleep 300 is 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/crun names the runtime to call and -b …/userdata gives 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:

Terminal window
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.json

Here 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:

Terminal window
podman --runtime runc run -d --name moteur-runc "$IMG" sleep 300
podman inspect -f '{{.OCIRuntime}}' moteur-runc
ps -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 Exercise 1 of 2 · ~8 min · terminal

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.

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
Terminal window
podman info --format '{{.Host.OCIRuntime.Name}}'
podman run -d --name exo-a "$IMG" sleep 300
mkdir -p /etc/containers/containers.conf.d
cat > /etc/containers/containers.conf.d/runtime.conf <<'CONF'
[engine]
runtime = "runc"
CONF
podman info --format '{{.Host.OCIRuntime.Name}}'
podman run -d --name exo-b "$IMG" sleep 301
podman inspect -f '{{.OCIRuntime}}' exo-a
podman inspect -f '{{.OCIRuntime}}' exo-b
ps -eo args | grep conmon | grep -v grep | grep -oE "exo-[ab]|-r [^ ]+ -b"
crun --root /run/crun list
runc --root /run/runc list
rm /etc/containers/containers.conf.d/runtime.conf
podman info --format '{{.Host.OCIRuntime.Name}}'
podman rm -f -t 0 exo-a exo-b

Before 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):

Terminal window
ctr image pull "$IMG"
ctr run -d "$IMG" demo-ctr sleep 300
ctr task ls
ps -eo pid,ppid,comm,args --forest | grep -E "containerd|sleep 300" | grep -v grep

The 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 300

The 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:

Terminal window
systemctl show containerd -p KillMode
systemctl restart containerd
ctr task ls
ps -eo pid,comm,args | grep "sleep 300" | grep -v grep

After 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 Exercise 2 of 2 · ~8 min · terminal

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.

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
Terminal window
ctr run -d "$IMG" exo-ctr sleep 302
systemctl show containerd -p KillMode
mkdir -p /etc/systemd/system/containerd.service.d
cat > /etc/systemd/system/containerd.service.d/killmode.conf <<'CONF'
[Service]
KillMode=control-group
CONF
systemctl daemon-reload
systemctl show containerd -p KillMode
systemctl restart containerd
sleep 2
ctr task ls
ps -eo pid,comm,args | grep "sleep 302" | grep -v grep
ps -eo comm | grep -c containerd-shim
ctr container ls
rm /etc/systemd/system/containerd.service.d/killmode.conf
rmdir /etc/systemd/system/containerd.service.d
systemctl daemon-reload
systemctl restart containerd
systemctl show containerd -p KillMode
ctr run -d "$IMG" exo-ctr2 sleep 303
systemctl restart containerd
ctr task ls
ctr container rm exo-ctr
ctr task kill -s SIGKILL exo-ctr2
ctr container rm exo-ctr2

Before 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.

Terminal window
podman rm -f -t 0 moteur-podman moteur-runc
ctr task kill -s KILL demo-ctr
ctr task rm demo-ctr
ctr container rm demo-ctr

To 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.

ToolResident daemon?Monitor or shimOCI runtimeKernel
Podman 5.4.2noconmon 2.1.12crun 1.21 (or runc)namespaces, cgroups v2
containerd 1.7.24 (ctr)containerdcontainerd-shim-runc-v2runc 1.1.15namespaces, cgroups v2
Kubernetes (not run in this lesson)kubelet on each node, then the engine's daemonthe engine'sthe engine's, runc in generalnamespaces, 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.

LayerExamplesWhat it doesWhat it delegates
OrchestratorKubernetes, Docker Swarm (in French), Nomad (in French)several machines, desired state, scheduling, restartexecution to each node's engine (CRI for Kubernetes)
Multi-container descriptionDocker Composedescribes several containers in YAML on a single hosteverything else to that host's engine
Enginecontainerd, CRI-O, Podman, Docker Engineimages, storage, network, lifecycle, APIexecution to the OCI runtime
Low-level runtimerunc, crunruns a bundlenothing: 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.

SituationTool to look at
Local development, a few containers on your workstationDocker Compose
A single machine, several servicesCompose, or Docker's Swarm mode
A few machinesDocker Swarm (in French) or Nomad (in French)
Cloud-native production, large fleetKubernetes
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.

SymptomCauseSolution
You do not know which runtime your engine usesEach engine has its default runtimePodman: 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 runningEach engine has its own state root: runc looks at /run/runc by defaultGive 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 containerdThe shim is the container's parent, not the daemonNormal 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 runningctr 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 containerdSeparate image storagePull 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 dockerd on containerd: its chain is described in the level 4 lesson.
  • Each engine has its image storage and its state root: an empty runc list proves 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

6 questions
6 min
70% to pass

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