Interview's MateDocker
Interview's Mate

Docker

Compose · Networking · Security · Ops

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Docker topics
Lesson 4/ 160
01. Containerization & Docker Fundamentals

containerd, runc & Open Container Initiative (OCI) Standards

Learn the low-level runtime stack: containerd, runc, and OCI image/runtime specs.

Intermediatecontainerd · runc3 quiz questions
Practice DevOps Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

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 spec for 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

Loading interactive 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.

Concrete containerd setup

ctr --namespace moby containers list && ctr --namespace moby tasks list; runc spec

Key takeaway: Prove runc with 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.

Deliberate failure test

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.

Key takeaway: containerd provides durable lifecycle management, while invoking runc directly is precise for low-level debugging but bypasses normal orchestration and recovery.

How it works, step by step

Step 1 of 4
Design

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

containerd manages containers over time, while runc performs the low-level “create this process” operation from an OCI bundle.
Key numbers at this step
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 mounts in 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

Explicit containerd
Best for: Learn the low-level runtime stack: containerd, runc, and OCI image/runtime specs, with a reviewed runbook.

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.

Ambient default
Best for: Short-lived runc experiments with low blast radius.

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.

Managed OCI Specs
Best for: Teams that centralize OCI Specs policy across many workloads.

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 spec as proof and skipping runc 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 spec address 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?
Interview tip: Give one concrete operation-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

Loading quiz

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.

Open DevOps Q&A →Tech Learn Q&A
Previous topic
Docker Architecture (Docker Engine, Daemon, CLI, REST API)
Next topic
Installing Docker (Linux, Docker Desktop on Windows/Mac, WSL2)