Skip to content
Back to the catalog
Project container-runtimeSystemsExpertComing soon

Build your own container runtime

Build a container runtime from scratch. Isolate processes with namespaces, cgroups and chroot to understand how Docker 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

Project in preparation: we are completing and verifying the implementation path and its tests. The capabilities below describe the project goal; starting the project is not enabled yet.

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.

  2. Phase 22 stages

    Its own filesystem

    An extracted rootfs, pivot_root, and mounting /proc.

  3. Phase 32 stages

    Setting limits

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

  4. Phase 42 stages

    Networking and privileges

    Network namespace, user namespaces, and capability dropping.

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
    Coming soon

    Build your own shell

    Build a POSIX shell from scratch. Use fork, exec, pipes and redirection to write a command interpreter that runs real programs.

    Intermediate12 stages~14 hSystems
    processesforkexec+2

    C · Rust · Go · Zig

  • garbage-collector
    Coming soon

    Build your own garbage collector

    Build a garbage collector from scratch. Implement mark and sweep, track live objects and reclaim memory like the runtimes you use every day.

    Expert9 stages~18 hSystems
    memorymark and sweeppointers

    C · C++ · Rust

  • neural-network
    Beta

    Build your own neural network

    Build a neural network from scratch. Implement the forward pass, loss functions and gradient descent, then train and run your own model.

    Beginner6 stages~6 hSystems
    machine learningneural networksmath+1

    Python · TypeScript