install the rootless docker prerequisites with docker itself

Reported from a member's daemon failing: "rootless Docker needs these packages on
the host: uidmap".

They were being installed — but only inside branch [2] "rootless Docker for
<owner>" in section 22. The owner's choice is not the only one that matters: every
Developer account the platform provisions gets its own rootless daemon whatever the
owner picked for themselves. So on a machine where the owner chose the docker
group, the host never got them and every member's daemon failed.

Moved into install_docker_engine, so they arrive with Docker rather than with one
particular answer to a question about the owner.

Three packages, not the one in the error. checkDockerPrerequisites in
os-user-docker.ts is the authority and wants uidmap (newuidmap, newgidmap) AND
docker-ce-rootless-extras (dockerd-rootless-setuptool.sh); dbus-user-session is
what keeps a member's systemd --user alive without a login session. rootless-extras
is only RECOMMENDED by docker-ce — installed by default, so usually there by luck,
and absent on any host configured with --no-install-recommends. Named explicitly.

Reproduced on this machine while checking: rootless-extras present via Recommends,
uidmap absent, newuidmap and newgidmap missing. Exactly the reported failure, on a
box that chose the docker group.

The rootless branch still installs uidmap and dbus-user-session behind its
pkg_is_installed guard. Redundant now, kept deliberately: it is the only thing that
fixes a machine whose Docker was installed by an older run of this script.

Verified: bash -n on both files, and all three packages present in the noble
archive.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-14 11:58:23 +00:00
co-authored by Claude Opus 5
parent e881015df5
commit 1d95ad3d1b
2 changed files with 27 additions and 2 deletions
+24 -1
View File
@@ -72,7 +72,30 @@ install_docker_engine() {
>/etc/apt/sources.list.d/docker.list >/etc/apt/sources.list.d/docker.list
pkg_refresh >/dev/null pkg_refresh >/dev/null
pkg_install_now docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# ── The rootless prerequisites go in HERE, not in the rootless branch ──
#
# They used to be installed only when the owner picked "[2] rootless Docker for
# me" in section 22. But the OWNER's choice is not the only one that matters:
# every Developer account the platform provisions gets its own rootless daemon,
# whatever the owner picked for themselves. So on a machine where the owner chose
# the docker group, the host never got these and every member's daemon failed
# with `rootless Docker needs these packages on the host: uidmap`.
#
# `src/servers/os-user-docker.ts` → checkDockerPrerequisites is the authority on
# this list, and it wants both:
#
# uidmap /usr/bin/newuidmap, /usr/bin/newgidmap
# docker-ce-rootless-extras /usr/bin/dockerd-rootless-setuptool.sh
#
# docker-ce only RECOMMENDS rootless-extras. That is installed by default, so it
# is usually there by luck — and is not on a host configured with
# --no-install-recommends. Named explicitly so it does not depend on that.
#
# dbus-user-session is what lets a member's systemd --user survive without a
# login session, which is how the daemon stays up.
pkg_install_now docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin \
docker-ce-rootless-extras uidmap dbus-user-session
} }
# A shared network so containers from different compose files can reach each # A shared network so containers from different compose files can reach each
+3 -1
View File
@@ -1761,7 +1761,9 @@ if ! skip; then
elif ! docker_is_installed; then elif ! docker_is_installed; then
echo "" echo ""
echo " to install: docker-ce, the CLI, containerd, buildx and compose," echo " to install: docker-ce, the CLI, containerd, buildx and compose,"
echo " from Docker's own repository" echo " from Docker's own repository — plus uidmap,"
echo " dbus-user-session and docker-ce-rootless-extras,"
echo " which every member's own rootless daemon needs"
if confirm "Install it?"; then if confirm "Install it?"; then
if install_docker_engine; then if install_docker_engine; then
ok "$(docker --version 2>/dev/null | cut -d, -f1) installed" ok "$(docker --version 2>/dev/null | cut -d, -f1) installed"