Repository navigation
Offer rootless Docker next to the system daemon - #14077
c4software wants to merge 7 commits into
Conversation
|
|
Nice, small, opt-in design, and the context-based routing that keeps
Worth stating in the PR too: the rootless path depends on an AUR package ( |
|
Good catch, fixed in 4544f71: setup now checks |
|
On the AUR dependency, I added a "Why an AUR dependency" section to the description. In short: The rootless path depends on
The package is small: no build step, its PKGBUILD downloads Alternatives considered:
The tradeoff is that an AUR package is not vetted like one from extra and can lag behind a |
|
Thanks, recording whether setup turned linger on, and only undoing it in that case, is the right shape. The "Why an AUR dependency" section helps maintainers weigh it. LGTM for whichever direction they pick. |
4544f71 to
82e1cb0
Compare
Since #8056,
dockerneedssudounless you opt into the docker group, which is root-equivalent. This adds a third way that keeps the protection: a rootless Docker daemon for your user, next to the system daemon rather than replacing it.docker …→ your rootless daemon: no sudo, no docker group, a container can only reach what your user can.sudo docker …→ the system daemon, unchanged: the Windows VM, the Docker TUI behind its prompt, privileged containers, existing workloads.Nothing is migrated and the system daemon is never touched, so it's opt-in and fully reversible. It is a much smaller, opt-in alternative to #11386 (which migrates everyone to rootless) and #11032 (Podman), usable today while those are being decided.
Setup > Security > Rootless Docker
omarchy-setup-security-rootless-docker, after a confirm explaining the two daemons and the rootless limits:rootlesskitandslirp4netns(extra) anddocker-rootless-extras(AUR — Arch'sdockerdoesn't ship upstream's rootless script and user unit, see archlinux/packaging/packages/docker#33);--restartcontainers survive logout and start at boot;docker.serviceuser unit (notdockerd-rootless-setuptool.sh install, whose generated unit pinsPATH);rootlessdocker context and selects it. A context rather thanDOCKER_HOST: plaindockerpicks it up, whilesudoruns with root's own config and keeps reaching/var/run/docker.sock.Why an AUR dependency
The rootless path depends on
docker-rootless-extras, which is only in the AUR. Arch'sdockerpackage (extra) ships the engine and CLI but none of upstream's rootless pieces (archlinux/packaging/packages/docker#33), and the daemon cannot start without them:/usr/bin/dockerd-rootless.sh, upstream's launcher that startsdockerdinside a user namespace through rootlesskit;docker.serviceanddocker.socketuser units that run it, which is what setup enables.The package is small: no build step, its PKGBUILD downloads
dockerd-rootless.shfrom the moby repository at the tag matching the packaged version, checksummed, and adds the units.rootlesskitandslirp4netnscome from extra.Alternatives considered:
dockerd-rootless-setuptool.sh install: not in Arch'sdockereither, and the unit it generates pinsPATH.The tradeoff is that an AUR package is not vetted like one from extra and can lag behind a
dockerupdate. It is only installed for users who opt in from Setup > Security, never by default.Remove > Security > Rootless Docker
omarchy-remove-security-rootless-dockerdisables the user unit, switches back to thedefaultcontext and removesrootless, and turns linger back off when setup is what turned it on (a linger the user already had is kept). Images and volumes stay in~/.local/share/docker; it prints how to delete them (rootlesskit rm -rf, since they belong to subordinate UIDs).The menu rows are guarded on
systemctl --user is-enabled docker.service, so only the relevant one shows, like Sudoless Docker. The manual's Docker section describes the option and its tradeoffs (ports < 1024, subordinate UIDs in bind mounts, separate images).Tests
test/shell.d/rootless-docker-toggle-test.sh: setup installs, enables linger and the user unit, creates/reuses and selects the context; declined, missing subuid range and already-enabled are no-ops; setup never calls systemsystemctl; remove restores the default context and is a no-op when off.menu-test,menu-guards-testand the existing sudoless Docker tests pass../test/clihas one failure (vscode generated theme references current theme file) that also fails on a cleanquattro.hello-world, bind mounts owned by the user for root containers, published ports, DNS,docker build,docker compose up,--memory/--cpuslimits (cgroup v2 delegation), native overlayfs on btrfs, and the system socket still refused without sudo. The menu rows were not checked visually in the running shell.