Skip to content

dockerd, containerd, the shim and runc

Select an icon to see what it is.

Step 6 of 6

Exit status flows back up

When the process exits, the shim collects its exit status and reports it to containerd, which tells dockerd. dockerd then updates State and writes the exit code. By default, stopping the Docker daemon also stops its containers, unless live-restore is turned on in daemon.json.

PrevNext

TaskExit event

exit status: 0
containerd publishes the event to dockerd

Try it yourself

Find the shim and see who the container's parent is.

$ docker run -d --name web nginx
$ ps -ef --forest | grep -B1 -A2 containerd-shim
$ docker inspect --format '{{.State.Pid}}' web
$ sudo ls /run/containerd/io.containerd.runtime.v2.task/moby/
$ docker rm -f web

Quiz

1. What does runc do after the container's process starts?
2. What is in an OCI bundle?
3. What does containerd talk to dockerd over?