Run development containers with rootless Docker - #11386
Draft
acrogenesis wants to merge 10 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Omarchy currently keeps ordinary users away from the root-equivalent system Docker socket, which leaves development Docker behind repeated privilege prompts. This proposal runs development workloads in Docker's per-user rootless daemon while preserving the Docker CLI and API, Compose, Buildx, lazydocker, images, and the existing
d='docker'alias. It is a direct-Docker alternative to #11032 for side-by-side review.Fresh installs allocate nonoverlapping subordinate UID/GID ranges after checking every resolvable account and both subordinate-ID databases. Omarchy then prepares the account-owned daemon configuration, enables only that initialized user's service, and selects
$XDG_RUNTIME_DIR/docker.sockthrough a marker-gated systemd environment generator. The daemon runs with a fixed packagedPATH, fixed configuration root, bounded JSON logs, private cgroups, seccomp, and verified RootlessKit/dockerd arguments.Existing installs receive an automatic, batch-preflighted migration from the system daemon. Compatible containers retain their writable layer, exact application configuration, supported limits, localhost ports, restart policy, capability ceiling, and private named-volume contents and metadata. The migration fails closed before stopping anything when it cannot reproduce a workload safely, including privileged mode, added capabilities, host paths, devices, shared volumes, custom networking/runtime/confinement/logging, or unknown nondefault host settings.
The cutover is journaled and crash-replayable. Omarchy quiesces the complete batch before revoking connected rootful clients, seals source volumes, transfers committed images by identity, pins destination volumes with an inert never-started guard, forces copied filesystems to stable storage, and keeps a durable Docker event window that rejects even transient foreign mounts. Runtime verification and receipt publication bind the exact source and destination snapshots. Failures before the first destination start restore the source and remove only proven-owned artifacts; once a destination start may have occurred, both copies remain stopped for explicit inspection. Successful rootful copies remain stopped with restart disabled as recovery data.
Windows stays on a separate rootful Docker daemon because KVM, TUN, and
NET_ADMINrequire that boundary./run/docker.sockbecomesroot:rootmode0600; the Windows command pins the socket and protected host paths, keeps Compose and credentials root-only, preserves lifecycle across reconciliation, and authenticates every terminal or graphical operation throughsudoorpkexec.Companion package PR: omacom/omarchy-pkgs#405
Validation
./test/cliquattrodocker-rootless-extrasbuild and generated-service inspectionScreenshots
The first capture shows migrated containers, Docker images, private volumes, and the stock Docker network in lazydocker. The second shows the active rootless daemon and per-user store after reboot while the desktop user remains denied access to the rootful Windows socket.