Skip to content

Run development containers with rootless Docker - #11386

Open
acrogenesis wants to merge 40 commits into
omacom:quattrofrom
acrogenesis:feature/rootless-docker
Open

acrogenesis wants to merge 40 commits into
omacom:quattrofrom
acrogenesis:feature/rootless-docker

Conversation

@acrogenesis

@acrogenesis acrogenesis commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

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.sock through a marker-gated systemd environment generator. The daemon runs with a fixed packaged PATH, 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_ADMIN require that boundary. /run/docker.sock becomes root:root mode 0600; 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 through sudo or pkexec.

Packaging prerequisite: omarchy-pkgs#405 was closed unmerged. The required environment generator, rootful socket drop-in and ONCE user unit are still missing from upstream settings; this proposal is not ready to merge until those payloads are integrated.

Rootless ONCE

ONCE setup refuses legacy package providers before package changes, and remains retryable from the menu until its user service is enabled. Installation and launch require the account’s rootless Docker setup marker before installing ONCE or starting the daemon.

ONCE now runs as a user service against the local rootless engine, with a loopback-only proxy on HTTP 8080 / HTTPS 8443. The launcher clears remote Docker overrides, verifies rootless operation, requires the patched ONCE build, disables binary self-update, and keeps backups private. One-time package/lingering setup can require administrator access; ONCE and its applications run without sudo.

The earlier companion packaging proposal adds a source-built once v0.3.2-omarchy1. Real Writebook testing found two Podman restore incompatibilities that reported success without restored content: archive entry prefixes and extraction through an unstarted temporary container's root filesystem. The patch normalizes backup paths, restores directly into the volume, rejects malformed legacy archives, and waits for final exec status. Rootless proxy settings are opt-in, preserving legacy rootful defaults outside the launcher.

Existing rootful ONCE deployments still need explicit, verified backup/restore migration. A legacy ONCE package or an active/enabled legacy system service keeps generic engine migration pending; the rootless once package alone does not. An active/enabled legacy manager stops the optional installer before package/service changes. The new installer does not adopt or delete old application data. Public hosting/automatic public HTTPS are outside this local desktop integration.

Validation: built and installed the exact source package in Omarchy Lab; upstream internal Go suite and new archive/exec/proxy regressions pass. Writebook creation, authenticated content and credential preservation through backup/restore, stop/start, container replacement, actual scheduled update/backup checks and reboot pass on each engine. Verified user-owned background processes, mode-0600 backups, loopback listeners and unchanged host privileged-port restrictions. New launcher/installer guards, focused migration/posture tests and CLI pass. Four real settings payload builds verify both variants on both proposals. This is targeted Lab validation, not a fresh ISO run or a new independent review loop.

Earlier Lab validation

  • Fix first-install migration failure at 8f42fad8: call reset-failed only when the user Docker service is failed. New behavioral coverage rejects the previous implementation, verifies fresh/inactive, failed and active states, and preserves fatal reset/enable/start failures. Posture/migration suites and full CLI pass. A disposable real systemd service in Lab reproduces the original unloaded-unit error, passes first-start and failed-state recovery with the new setup block, and preserves its invocation when active; the running Docker workload was not restarted.
  • Document socket-mount requirements at c32e98f6. On rootless Docker29.7.2/API1.55 with Compose5.5.1 in Lab, an unchanged application installer exits successfully and web/API checks return200, but actual sandbox creation fails connect EACCES /var/run/docker.sock. The app mounted the restricted rootful socket instead of the per-user socket. This rootless transition cost applies to both engine proposals; preserving Docker's API does not rewrite hardcoded mounts or establish application compatibility. No application edits or socket permission changes were used for this comparison.
  • This was a targeted deployment of c00141ed and matching required package/helper payloads, followed by the scoped service-setup regression above. It is not a fresh ISO or a repeated complete migration on the final head. The earlier review verdicts below apply to their recorded commits.

Validation

  • Current head c52a6e315824ed123d8b1babbb0049d65bab9d30 retains the normal merge of quattro 573b518be. CLI (125 checks), upgrade, posture and Windows suites pass. Windows checks that need no mounts execute before the namespace gate and pass with namespaces unavailable.
  • Logging preflight now requires the known destination driver/options before the source batch stops. The empty-options regression fails the old code; migration (50 groups) and failure-recovery suites pass with the fix.
  • Full VM CI correctly rejects the missing package settings described above; the same config test passes on the base branch with current upstream package recipes. The current VM run is running. Packaging checks remain enabled.

Earlier validation:

  • full ./test/cli
  • affected rootless migration/posture, configuration, provisioning, historical Docker-group, Windows security/Compose/mount, and bin-style suites
  • full 237-file shell audit; every affected suite passes, with remaining failures reproduced as unrelated baseline or local-environment failures
  • Python compilation, Bash syntax, whitespace checks, and clean merge-tree against current quattro
  • isolated docker-rootless-extras build and generated-service inspection
  • Omarchy Lab path deployment and focused suites, with no failed units or Hyprland errors
  • real Lab checks for daemon/socket identity, compatible running and stopped migrations, retained-volume retry, event-history enforcement, batch rollback, post-start retention, Compose, Buildx, lazydocker, reboot persistence, later-account initialization, and authenticated rootful Windows activation
  • repeated independent Codex review; final round reported no valid actionable findings

Earlier focused validation

Independent Claude Fable 5.1 and Codex review cycles completed; final followups report no actionable findings.

Windows setup stages private credentials before writing the privileged Compose definition and preserves existing credentials on failure. Removal deletes credentials and private staging files left by interrupted installs through linked config directories, without following file symlinks, and reports cleanup errors. Legacy Compose file symlinks are rejected before migration, preserving their targets for explicit handling. Nine isolated lifecycle regressions pass on each proposal.

ONCE provider and legacy-service migration guards, installer refusal before changes, and menu retry behavior pass regression tests. The menu retry and uninitialized-account refusals were also checked in Omarchy Lab without restarting the running ONCE workload. Windows compose, authorization and mount-boundary tests pass, including linked user config with no VM, authorized root-config repair, and private credential writes. The authorization test now isolates HOME. Rootless migration/posture and CLI checks pass.

This review cycle did not rerun the full ISO acceptance suite or rebuild ONCE; the earlier real Writebook lifecycle evidence below remains separate.

Screenshots

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.

Migrated rootless Docker containers, images, volumes, and networks in lazydocker

Rootless Docker daemon and root-only Windows Docker socket verified in Omarchy Lab

Writebook content restored through rootless Docker and ONCE in Omarchy Lab

@acrogenesis
acrogenesis marked this pull request as ready for review September 14, 2026 22:32
@axelfontaine

Copy link
Copy Markdown
Contributor

Now that the user is no longer a member of the docker group, this PR is essential for usability and out-of-the-box compatibility with existing Docker flows.

With the current defaults Testcontainers can't even start. This saves everyone the manual tweaking.

@axelfontaine

Copy link
Copy Markdown
Contributor

@acrogenesis While working out the details of this solutions, please also consider this use-case for an even better out-of-the-box experience:

@omarchybot omarchybot added the enhancement New feature or request label Sep 27, 2026
@osde8info

osde8info commented Sep 28, 2026 •

Copy link
Copy Markdown

dont waste any effort on docker just switch to podman see #11032

@greptile-apps

greptile-apps Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] No new blocking issue was established; the acknowledged packaging prerequisite still needs to land before merging.

Summary

Moves development containers to per-user rootless Docker while keeping Windows on an authenticated rootful daemon.

  • Development Docker runs in a separate rootless daemon for each user.
  • Windows VM actions use rootful Docker only through an authenticated boundary.
  • ONCE manages local apps through the user's rootless Docker daemon.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Initialize user Docker] --> B[Check the complete source batch]
  B --> C[Stop sources and seal volumes]
  C --> D[Restart rootful Docker to close old clients]
  D --> E[Copy and verify images and volumes]
  E --> F[Create and verify destination]
  F --> G[Record start intent and start]
  G --> H[Verify and publish completion]
  E -->|Failure before destination start| I[Restore eligible sources]
  G -->|Failure after start attempt| J[Stop owned destination and retain both copies]
Loading

Reviews (16) · Last reviewed commit: "Merge current quattro into feature/rootl..." · Reviewed by Greptile

Comment thread migrations/1789164756.sh Resolved
Comment thread default/docker/rootless/migrate.py Resolved
@acrogenesis

Copy link
Copy Markdown
Member Author

Thanks for linking #14077. It offers the smaller opt-in approach alongside the system daemon; this PR remains the automatic-migration alternative for comparison with that proposal and #11032. Maintainers still need to choose the direction.

Resolved the current quattro conflicts through a normal merge at a6bb877, retaining the reviewed migration safeguards and intentional removal of the legacy sudoless-Docker toggle. The CLI and 13 focused configuration, migration, ONCE and Windows suites completed without failures; the separate packaging-checkout check was skipped.

@omarchybot omarchybot added the enhancement New feature or request label Oct 14, 2026
Comment thread migrations/1789164756.sh Resolved
Comment thread default/omarchy/omarchy-menu.jsonc Resolved
Comment thread default/docker/rootless/migrate.py Resolved
Comment thread test/shell.d/once-migration-test.sh Resolved
Comment thread default/docker/rootless/migrate.py Resolved
Comment thread test/shell.d/windows-vm-compose-test.sh Resolved
@acrogenesis

Copy link
Copy Markdown
Member Author

Updated the existing branch to current quattro. Preserved legacy Windows credentials with the newer escaped-password fixture, and moved architecture stubbing before authentication/credential checks. A simulated ARM host fails on the old test and passes on the updated test; focused migration, failure-recovery, Windows, posture, configuration and CLI checks pass with the paired settings proposal.

Full native CI checks the official package base and currently fails its configuration check for the rootless environment generator, authenticated system socket drop-in and optional ONCE unit. The existing omacom/omarchy-pkgs#369 now ships these conditionally for the selected source and verifies protected helper ownership/modes. The separate docker-rootless-extras runtime prerequisite is outside that settings-only change. Maintainer selection of the container approach remains open.

@osde8info

Copy link
Copy Markdown

why cant we stop wasting time on docker and just switch to podman ?

Comment thread default/docker/rootless/migrate.py Resolved
@omarchybot omarchybot removed the enhancement New feature or request label Nov 20, 2026
@omarchybot omarchybot added the enhancement New feature or request label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants