Skip to content
Back to the catalog
Project container-runtimeSystemsExpertBeta

Build your own container

namespaces, cgroups and chroot. Isolate a process by hand and understand what Docker does when it starts an image.

Build it in your language

The tester treats your program as a black box: any language works. These are just the most convenient ones for this project.

Guide language

The stage guides read in this language. Only languages this project is fully translated into show up here; the interface language does not change.

What this project is about

A container is not a virtual machine, nor a new technology: it's an ordinary Linux process that the kernel has lied to about what it can see. This challenge teaches you to tell those lies.

You'll isolate a process by hand with namespaces, change its filesystem root, limit its CPU and memory with cgroups, and drop its privileges. By the end you'll have your own run able to boot the filesystem of a real image.

Roadmap

8 stages across 4 phases. Every stage comes with its guide and its tests: you move on when they pass.

  1. Phase 12 stages

    Isolating the process

    Spawn a child with its own PID, UTS and mount namespaces.

    1. 01Creating namespaces
    2. 02Container init process
  2. Phase 22 stages

    Its own filesystem

    An extracted rootfs, pivot_root, and mounting /proc.

    1. 01Rootfs and layers
    2. 02pivot_root and proc
  3. Phase 32 stages

    Setting limits

    cgroups v2 for CPU and memory, and behaviour when they're reached.

    1. 01Memory limit
    2. 02CPU limit
  4. Phase 42 stages

    Networking and privileges

    Network namespace, user namespaces, and capability dropping.

    1. 01Network namespace
    2. 02Users and capabilities

Before you start

A minimal container runtime for Linux: namespace creation (PID, mount, UTS, network, user), pivot_root onto an extracted rootfs, mounting /proc, CPU and memory limits with cgroups v2, capability dropping, and a run-style command-line interface.

  • shell
    Beta

    Build your own shell

    fork, exec, pipes and redirection. Build a POSIX command interpreter that runs real programs.

    Intermediate12 stages~14 hSystems
    procesosforkexec+2

    C · Rust · Go · Zig

  • neural-network
    Ready to build

    A Neural Network from Scratch

    Build and train a neural network from first principles: forward pass, loss functions, and gradient descent optimization.

    Beginner6 stages~6 hSystems
    machine learningneural networksmath+1

    Python · TypeScript

  • garbage-collector
    Beta

    A garbage collector

    Mark-and-sweep from scratch. Manage memory the way the runtimes you use daily do without you noticing.

    Expert9 stages~18 hSystems
    memoriamark & sweeppunteros

    C · C++ · Rust