Chapter 26Lesson 03~130 minutes

Rootless Docker, RootlessKit, User Namespaces, Networking, Storage, Limitations, and Threat Reduction: Configuration, Design Choices, and Tradeoffs

Choose between rootless, tightly controlled rootful Docker, isolated builders, and VM/sandbox boundaries using explicit trust, performance, networking, storage, and operational evidence.

Design choicescgroup v2StorageNetworkingIsolation

Learning objectives

  • Choose rootless versus rootful/userns/VM boundaries from workload trust and compatibility requirements.
  • Explain RootlessKit networking, cgroup v2 delegation, and supported storage-driver tradeoffs.
  • Evaluate rootless builders/CI without confusing inner non-root identity with outer privileged DinD authority.
  • Describe Docker Desktop as a VM-based boundary rather than ordinary native rootless Engine.
Design principle. Choose rootless for a documented threat and workload fit. Do not accept hidden incompatibility, and do not call a VM or privileged DinD “rootless” merely because one inner process runs as a non-root UID.

1. Rootless versus rootful least privilege: choose the daemon boundary intentionally

Option Strength Cost / limitation Use when
Rootless Engine Daemon and containers begin without host-root privilege. User-namespace/network/storage/cgroup limitations; shared host kernel. Single-user development, CI builders, services that fit rootless constraints.
Rootful Engine + strict runtime controls Broad feature compatibility and mature networking/storage. Daemon/socket are root-equivalent; compromise can have larger host impact. Features requiring host-level integration with strong operational controls.
Rootful + userns-remap Containers are remapped but daemon remains root. Different mapping/compatibility model; daemon attack surface remains privileged. Need rootful daemon features while reducing container UID authority.
VM / stronger sandbox Separate kernel/hypervisor boundary. More resource/operational overhead. Hostile multi-tenancy or shared-kernel risk outside tolerance.

2. RootlessKit network choices are operational choices, not invisible implementation details

Current rootless networking can use combinations of gvisor-tap-vsock, slirp4netns, pasta, and specific port drivers. Their throughput, source-IP behavior, SUID/helper requirements, and support status differ. Docker Engine 29.5 packaging stopped installing slirp4netns by default and introduced gvisor-tap-vsock as the preferred default path; Engine 29.8 updates RootlessKit to 3.1.0 and adds an optional pesto port driver with pasta.

Do not tune this from folklore. Capture Engine/RootlessKit versions, current driver configuration, actual latency/throughput, and source-IP requirements first.

3. Rootless BuildKit / daemon for CI versus privileged Docker-in-Docker

A user-owned rootless daemon or rootless BuildKit worker can be a useful CI boundary because build jobs do not need access to a shared rootful daemon socket. That reduces one class of escalation path. It does not automatically make untrusted builds safe: the kernel remains shared, build inputs can exfiltrate credentials, cache trust still matters, and host mounts can expand authority.

Docker documents a dind-rootless image, but when it is launched inside a rootful container it still requires outer --privileged. That means “rootless inside” must not be described as removing the outer privileged-container risk.

4. Resource governance: cgroup v2 + systemd delegation is a prerequisite, not a tuning hint

Rootless CPU, memory, and PID limits are supported when the host uses cgroup v2 and systemd can delegate the needed controllers to the user service. If the host does not provide that hierarchy, the right correction is at the host/user-service architecture—not pretending the Docker flag succeeded.

stat -fc %T /sys/fs/cgroup
systemctl --user status docker --no-pager 2>/dev/null || true
docker info --format 'CgroupVersion={{.CgroupVersion}} CgroupDriver={{.CgroupDriver}}' 

5. Storage design: choose supported state, then verify the actual driver

On modern Linux kernels, rootless overlay2 is preferred when supported. fuse-overlayfs provides compatibility on older kernels; btrfs and vfs have their own prerequisites/tradeoffs. Rootless Docker’s user-owned data root should not be placed on unsupported backing storage such as NFS.

Because a rootless daemon has its own image/container store, cache lifecycle and disk accounting are also per-daemon concerns. “The host has the image” is ambiguous unless the daemon/context is named.

6. Separate user daemons versus one shared rootful daemon

Per-user rootless daemons give users separate sockets, image stores, caches, networks, and container inventories. That improves isolation of Docker control planes but duplicates storage and may complicate shared-build caching. A shared rootful daemon centralizes storage and operations but gives every authorized socket client root-equivalent power over that host.

The decision is therefore about trust and tenancy, not convenience alone.

7. Docker Desktop is not “rootless Engine on your laptop”

Docker Desktop runs Docker Engine inside a managed Linux VM. Docker’s own Linux FAQ explicitly explains that Desktop chose a VM rather than ordinary rootless Docker to obtain a dedicated kernel and consistent cross-platform behavior. On macOS and Windows, container root is root inside that Linux VM, not root on the macOS/Windows host; host file sharing is an explicit boundary.

When comparing threat models, say native Linux rootless Engine, native Linux rootful Engine, or Docker Desktop VM Engine. Collapsing them into one “non-root Docker” category hides the most important boundary.

8. Decision worksheet

Requirement Evidence to collect Likely direction
No root-equivalent local Docker socket for developer Context/socket ownership, rootless SecurityOptions Rootless Engine fits if feature needs are compatible.
Need overlay network / unsupported rootless feature Rootless limitations + actual workload requirement Rootful Engine or different orchestrator/boundary.
Hostile multi-tenant code Kernel-sharing threat model VM/sandbox boundary; rootless alone is insufficient.
CI image builds with no host device/network integration Cache/network needs, cgroup delegation Dedicated rootless builder/daemon can reduce authority.
Heavy network throughput Measured rootless network path vs native Native nodes/rootful/VM strategy based on benchmark and trust.
Strict CPU/memory/PID limits cgroup v2 + systemd delegation evidence Rootless only if delegation works as required.

Knowledge check

When is rootless Engine a poor substitute for a VM?

Why is rootless DinD inside a privileged rootful container not “fully unprivileged”?

What changed for packaged rootless networking in Engine 29.5?

Why are separate user rootless daemons not free operationally?

Why should Docker Desktop be analyzed separately from native rootless Engine?

Next lesson

Next: Rootless Docker, RootlessKit, User Namespaces, Networking, Storage, Limitations, and Threat Reduction: Diagnostics, Failure Modes, Security, and Performance

Continue with the next lesson in the course sequence and carry forward the evidence-first Docker operating model.

Official references and version notes

Version/platform baseline, verified 2026-09-22.

Docker Engine 29.8.1 is the current Engine release. Engine 29.5 changed packaged rootless networking so gvisor-tap-vsock is the preferred/default path when slirp4netns is not separately installed, and rootless host networking now reaches the real host network namespace. Engine 29.8 updates RootlessKit to 3.1.0 and adds the optional pesto port driver when paired with pasta (IPv4 only). Rootless resource limits require cgroup v2 plus systemd delegation; rootless storage support is host/kernel dependent. Docker Desktop uses an Engine inside a managed Linux VM and must not be described as ordinary Rootless Docker. Every lab therefore records actual docker version, context, security options, cgroup/storage/network state rather than assuming upstream defaults.

Keep the academy open

Support free, practical DevOps education.

Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.

Ethereum / ERC-20
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0Send only Ethereum/ERC-20 compatible assets to this address.