containerd, runc & Open Container Initiative (OCI) Standards
Learn the low-level runtime stack: containerd, runc, and OCI image/runtime specs.
In plain words
containerd manages containers over time, while runc performs the low-level “create this process” operation from an OCI bundle.
Think of it like…
containerd is the foreman holding blueprints and work orders; runc is the crew member who wires the site for each job.
Where you’ve seen it
In practice, ctr --namespace moby containers list && ctr --namespace moby tasks list; runc spec is the concrete move for this job: learn the low-level runtime stack: containerd, runc, and OCI image/runtime specs. The release is not accepted until runc state <container-id> or ctr task ls, then compare the OCI config.json process and mounts confirms the result.
Words you’ll hear
- containerd
- The implementation control in
ctr --namespace moby containers list && ctr --namespace moby tasks list; runc specfor learn the low-level runtime stack: containerd, runc, and OCI image/runtime specs. - runc
- The result to observe with
runc state <container-id> or ctr task ls, then compare the OCI config.json process and mounts, rather than infer from a successful command alone. - OCI Specs
- The production boundary exposed when treating containerd like an application API or expecting a successfully pulled image to prove that the OCI runtime can launch it.
Visual diagram
Theory & deep dive
containerd control path
The concrete mechanism is ctr --namespace moby containers list && ctr --namespace moby tasks list; runc spec. The observable result is runc state <container-id> or ctr task ls, then compare the OCI config.json process and mounts; if those disagree, inspect the runtime evidence before changing unrelated settings.
Learn the low-level runtime stack: containerd, runc, and OCI image/runtime specs. Keep containerd, runc and OCI Specs in the same deployment record so the intent and the observed state cannot drift apart.
ctr --namespace moby containers list && ctr --namespace moby tasks list; runc spec
runc state <container-id> or ctr task ls, then compare the OCI config.json process and mounts, not with command success alone.OCI Specs failure boundary
Debugging at the wrong layer wastes time: containerd knows tasks and snapshots, runc errors reveal namespace/mount mistakes, and the OCI bundle exposes the exact configuration. Standards also let Kubernetes, Docker and Podman consume the same image format without rewriting applications. The narrow failure to design for is treating containerd like an application API or expecting a successfully pulled image to prove that the OCI runtime can launch it.
Accept this compromise explicitly: containerd provides durable lifecycle management, while invoking runc directly is precise for low-level debugging but bypasses normal orchestration and recovery. The controlled check-runc state <container-id> or ctr task ls, then compare the OCI config.json process and mounts-also identifies the point where a different design is safer.
Exercise this failure safely: treating containerd like an application API or expecting a successfully pulled image to prove that the OCI runtime can launch it.
How it works, step by step
Step 1 of 41. State the boundary
Write down why the workload needs this: Debugging at the wrong layer wastes time: containerd knows tasks and snapshots, runc errors reveal namespace/mount mistakes, and the OCI bundle exposes the exact configuration. Standards also let Kubernetes, Docker and Podman consume the same image format without rewriting applications.
- Intent
- containerd
When to use it & trade-offs
What it is
containerd is the long-running supervisor that pulls OCI content, manages snapshots, creates tasks and records state; runc is a short-lived OCI runtime that asks Linux namespaces, cgroups and mount APIs to materialize one container process. The image and runtime OCI specs define their interchange formats.
Why it matters: Debugging at the wrong layer wastes time: containerd knows tasks and snapshots, runc errors reveal namespace/mount mistakes, and the OCI bundle exposes the exact configuration. Standards also let Kubernetes, Docker and Podman consume the same image format without rewriting applications.
When to reach for it
- The fit is strongest for this job: learn the low-level runtime stack: containerd, runc, and OCI image/runtime specs. Pair it with
runc state <container-id> or ctr task ls, then compare the OCI config.json process and mountsin the runbook. - Production containerd changes should make runc observable through
ctr --namespace moby containers list && ctr --namespace moby tasks list; runc spec, rather than trusting the runtime default. - Keep a rollback example for the case where treating containerd like an application API or expecting a successfully pulled image to prove that the OCI runtime can launch it.
When to avoid or be careful
- Do not accept command success while the system can still fail by treating containerd like an application API or expecting a successfully pulled image to prove that the OCI runtime can launch it.
- Avoid erasing OCI Specs protection merely to dodge this cost: “containerd provides durable lifecycle management, while invoking runc directly is precise for low-level debugging but bypasses normal orchestration and recovery”.
- Do not replace the evidence path-
runc state <container-id> or ctr task ls, then compare the OCI config.json process and mounts-with a screenshot or a mutable tag.
ctr --namespace moby containers list && ctr --namespace moby tasks list; runc spec: practical choices
Strengths: containerd is the long-running supervisor that pulls OCI content, manages snapshots, creates tasks and records state; runc is a short-lived OCI runtime that asks Linux namespaces, cgroups and mount APIs to materialize one container process. The image and runtime OCI specs define their interchange formats.
Watch out: containerd provides durable lifecycle management, while invoking runc directly is precise for low-level debugging but bypasses normal orchestration and recovery.
Strengths: It can begin with ctr --namespace moby containers list && ctr --namespace moby tasks list; runc spec and fewer surrounding controls.
Watch out: It silently accepts treating containerd like an application API or expecting a successfully pulled image to prove that the OCI runtime can launch it, which makes the result hard to reproduce after promotion.
Strengths: Debugging at the wrong layer wastes time: containerd knows tasks and snapshots, runc errors reveal namespace/mount mistakes, and the OCI bundle exposes the exact configuration. Standards also let Kubernetes, Docker and Podman consume the same image format without rewriting applications.
Watch out: The platform adds an ownership and debugging layer; retain runc state <container-id> or ctr task ls, then compare the OCI config.json process and mounts as the direct check.
Interview signals & numbers to know
When this topic comes up
- ctr --namespace moby containers list && ctr --namespace moby tasks list; runc spec
- runc state <container-id> or ctr task ls, then compare the OCI config.json process and mounts
- Failure signature: treating containerd like an application API or expecting a successfully pulled image to prove that the OCI runtime can launch it
- Trade-off: containerd provides durable lifecycle management, while invoking runc directly is precise for low-level debugging but bypasses normal orchestration and recovery.
Benchmarks & rules of thumb
- 2 OCI specs
- image-spec and runtime-spec are the core contracts
- 1 task process
- runc creates and exits around the container lifecycle
- moby namespace
- where Docker stores much containerd state
Common mistakes & follow-ups
Common interview mistakes
- Treating a successful
ctr --namespace moby containers list && ctr --namespace moby tasks list; runc specas proof and skippingrunc state <container-id> or ctr task ls, then compare the OCI config.json process and mounts. - Treating containerd like an application API or expecting a successfully pulled image to prove that the OCI runtime can launch it
- Optimizing containerd without accepting that containerd provides durable lifecycle management, while invoking runc directly is precise for low-level debugging but bypasses normal orchestration and recovery.
Likely interviewer follow-ups
- Why does
ctr --namespace moby containers list && ctr --namespace moby tasks list; runc specaddress containerd here rather than through application code? - How would you distinguish healthy runc from the failure “treating containerd like an application API or expecting a successfully pulled image to prove that the OCI runtime can launch it” using
runc state <container-id> or ctr task ls, then compare the OCI config.json process and mounts? - When would this trade-off-“containerd provides durable lifecycle management, while invoking runc directly is precise for low-level debugging but bypasses normal orchestration and recovery”-justify a different OCI Specs design?
ctr --namespace moby containers list && ctr --namespace moby tasks list; runc spec-and one proof-runc state <container-id> or ctr task ls, then compare the OCI config.json process and mounts. Then name the boundary: treating containerd like an application API or expecting a successfully pulled image to prove that the OCI runtime can launch it.Knowledge check
Put it into practice
Practice related interview Q&A
Apply containerd, runc & Open Container Initiative (OCI) Standards with generative AI interview Q&A and hands-on practice.