A mini Docker engine built from scratch using Linux namespaces + cgroups.
No Docker. No containerd. Just raw syscalls.
boxr is a lightweight container engine that does what Docker does under the hood — isolate processes using Linux namespaces and cgroups — but with zero dependencies and clean, readable code.
Built to learn. Built to use. Built to be understood.
- ✅ PID namespace isolation — container gets its own PID 1
- ✅ UTS namespace — isolated hostname
- ✅ Mount namespace — private filesystem view
- ✅ IPC namespace — isolated interprocess communication
- ✅ cgroup v2 — CPU and memory limits
- 🔜 Network namespace + veth pair
- 🔜 Overlay filesystem (image layers)
- 🔜 Pull rootfs from Docker Hub registry API
# Linux only (requires root for namespace creation)
git clone https://github.com/manit6752025/boxr
cd boxr
go build -o boxr ./cmd/boxr
sudo ./boxr run /bin/shYou're now inside an isolated container. No Docker installed.
When you run boxr run /bin/sh, boxr:
- Forks a new process with
CLONE_NEWPID— giving it PID 1 - Adds
CLONE_NEWUTS— isolated hostname - Adds
CLONE_NEWNS— private mount namespace - Adds
CLONE_NEWIPC— isolated IPC - Applies cgroup v2 limits for CPU and memory
- Exec's your command inside that isolated environment
No layers. No images. No daemon. Just a process that thinks it's alone.
boxr/ ├── cmd/boxr/main.go # CLI entry point ├── internal/ │ ├── container/ │ │ ├── run.go # Namespace isolation │ │ └── cgroup.go # cgroup v2 limits │ ├── image/ # (coming soon) registry pull │ └── fs/ # (coming soon) overlay filesystem ├── docs/ │ └── how-it-works.md # Deep dive explanation └── .github/workflows/release.yml # Cross-platform release pipeline
You should use Docker in production. boxr exists to show you what's underneath — and to be a real, usable tool that doesn't need a 500MB daemon running to isolate a process.
- v0.1 — Namespace + cgroup isolation, cross-platform releases
- v0.2 — Network namespace, veth pair, internet inside container
- v0.3 — Overlay filesystem, image layers
- v0.4 — Pull and run Alpine from Docker Hub with no Docker
PRs welcome. Open an issue first for big changes.
MIT — free to use, modify, sell, build on.