Container Internals
Build a container by hand from namespaces, cgroups and an overlay root file system, and explain what container runtimes add.
4 objectives 6 steps about 140 min
Check what you know
The lessons are coming later. The knowledge check is ready now.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Explain each Linux namespace type and create isolated PID, mount, UTS, network and user namespaces with unshare and nsenter.
- Limit CPU, memory and process count with cgroup v2 and observe the limits being enforced.
- Assemble a minimal container from an image root file system with overlayfs, pivot_root, dropped capabilities and a seccomp filter.
- Relate these mechanisms to OCI images and runtimes (runc, crun, containerd, Podman) and compare container and virtual-machine isolation.
Lesson plan
6 steps, about 140 min · 0 of 5 lessons available so far
- A container is a process: namespaces, cgroups and a root file system Concept · 20 min · coming later
- Lab: isolate a shell with unshare - PID, mount, UTS, network and user namespaces Lab · 30 min · coming later
- Lab: cgroup v2 by hand - memory.max, cpu.max and pids.max Lab · 25 min · coming later
- Worked example: a mini container with overlayfs, pivot_root, capabilities and seccomp Worked example · 30 min · coming later
- What runtimes add: OCI bundles, runc, containerd, rootless Podman, and VMs compared Concept · 20 min · coming later
- Check: trace a container start down to kernel features Knowledge check · 8 questions
Practise it
Write a script minictr that starts a command in new PID, mount, UTS, network and user namespaces on an overlayfs root built from an exported image, inside a cgroup with memory and pids limits; demonstrate that a fork bomb and a memory hog stay contained.
Build it from scratch
Practice builds that exercise this skill by re-creating a real technology.
- Build your own Container RuntimeAdvanced · 12–24 h
References
Hard prerequisites
Unlocks
Nothing depends on this skill yet.
On these roadmaps
Progress and evidence for this skill are shared across all of them.