doos

Version: see VERSION (currently 0.1.1). Release history: CHANGELOG.md.

User-level containers in C++20: overlayfs over the host's /usr, /etc, /opt, user/mount/pid namespaces, networking through slirp4netns. No root at runtime.

doos list
doos get_or_create [--net slirp|host|none] NAME
doos attach [--net slirp|host|none] NAME [-- CMD...]
doos delete [--yes] NAME

Build: cmake -S . -B build && cmake --build build. Test: tests/run.sh.

Requirements: Linux >= 5.11, slirp4netns for the default network mode. On Ubuntu 24.04+ install the AppArmor profile once:

sudo cp apparmor/doos /etc/apparmor.d/doos && sudo apparmor_parser -r /etc/apparmor.d/doos

See SPEC.md (behavior, limits) and docs/RESEARCH.md (what works, measurements, known gaps).

Usage examples

doos get_or_create dev                  # created dev
doos attach dev                         # interactive shell as root inside
doos attach dev -- apt --version        # run one command
doos attach --net none sandbox -- sh    # no network at all
doos list
doos delete dev                         # dry run: shows what would go
doos delete --yes dev                   # really deletes

Container writes to /usr, /etc, /opt stay in the container (copy-on-write); /root and /var are private and persistent. /tmp is memory-backed and lost on exit. A container is running while its first attach command is alive; more attach calls join it. Data persists until delete --yes.

Configuration

Variable Meaning
DOOS_HOME State directory (default ~/.local/share/doos). No , or : allowed.
XDG_DATA_HOME Used as $XDG_DATA_HOME/doos when DOOS_HOME is unset.

Troubleshooting

Message Cause and fix
write /proc/<pid>/uid_map ... blocked or mount ...: Permission denied AppArmor restricts user namespaces. Install apparmor/doos (command above).
slirp4netns failed to start Install slirp4netns, or use --net none / --net host.
state path must not contain ',' or ':' Set DOOS_HOME to a plain path.
container 'x' is running on delete Exit the attached command first.
container limit reached (64) Delete one first.

Safety summary

Host files are never written: system dirs are reached only through overlayfs. Host /home, /sys and host loopback are not reachable in the default mode. --net host removes network isolation and is opt-in. Known gaps (no cgroups, readable host /etc) are listed in docs/RESEARCH.md.

Project docs

File Content
SPEC.md Behavior contract and limits
docs/ARCHITECTURE.md Code map and flows
docs/RESEARCH.md What works unprivileged, measurements, gaps
AGENTS.md Rules for AI agents, release workflow
CHANGELOG.md Release history
S
Description
User-level containers in C++20: overlayfs, user namespaces, slirp4netns/pasta networking, cgroup v2 limits, seccomp hardening. No root at runtime.
Readme MIT
228 KiB
Languages
C++ 72.4%
Shell 24.5%
Makefile 2.7%
CMake 0.4%