containerd, shims and Engine responsibilities
Worked example
This is an offline lesson. Data are fictional and Docker commands are unexecuted. Any optional execution requires an authorized disposable VM, a verified context, synthetic data, restricted access and no external transmission. Do not collect secrets or private output. Treat the worksheet as offline evidence. Before any separately authorized server query, verify the effective endpoint and its trust boundary, including context overrides. Do not change runtime state, mount host data or modify Desktop settings in this exercise.
Simplified Linux Engine flow (not a process listing):Docker CLI -> Docker Engine API / dockerdEngine -> containerd -> runtime shim -> OCI runtime -> Linux processContent -> snapshotter -> root filesystemSynthetic event: task exits, shim reports exit, Engine observes stopped containerThe CLI sends a request to the Engine, which coordinates Docker objects, networking and other policies. In the typical Linux stack containerd manages content, snapshots and task lifecycle; details depend on Engine storage backend and version. A runtime-v2 shim mediates task operations and can supervise the process and report its exit. The low-level runtime sets up the execution environment; the workload continues as its own process. A shim may outlive a short-lived runtime command. This is a conceptual responsibility map, not a promise that every installation has the same process tree, one shim per container or a separate containerd process. An Engine-managed containerd endpoint should not be treated as an independent administrative API. The event arrow represents a simplified notification path; do not infer synchronous delivery or a precise process-parent relationship. A task exit is not necessarily removal of Docker container metadata or image content.
Common mistake
Do not mutate Docker-managed tasks directly through containerd tooling; that can conflict with Engine state.
Manual practice
Assign image unpacking, task exit reporting and Docker API handling to the appropriate components. Explain why the responsibility map is not an exact process tree.
Worksheet: lab-fixtures/docker-container-internals/05-containerd/scenario.txt.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
containerd, shims and Engine responsibilities — Knowledge check
Interpret synthetic runtime and isolation evidence and explain kernel and OCI boundaries.
Which component handles Docker-facing API requests?
What can a runtime shim report?
Why avoid directly mutating Engine-managed tasks through another API?