fix: docker installs from Docker, never brew; VM guest rows

The docker-ce, buildx and compose rows named apt packages that only exist in
Docker's own repository, so on stock Ubuntu they fell through to brew. They
are a script channel now: get.docker.com downloaded to the run's workdir and
run from the file on Linux, Docker Desktop's DMG installer on macOS. One
install serves all three rows; the plugin rows report its outcome.

Also adds virt/guest-agent and virt/spice-vdagent, with tests and README.
This commit is contained in:
bcherb2 committed 2026-11-18 01:41:43 -05:00
1 parent a28a831a14
commit a538ab75dd
7 files changed
+365 -31

No files matched your search

+133 -2
View File
@@ -423,6 +423,14 @@ SUDO=
if [ "$(id -u)" != 0 ] && command -v sudo >/dev/null 2>&1; then SUDO=sudo; fi
FAILED=$STATE/.failed.$$
APT_UPDATED=0
# The docker group is three manifest rows and ONE install: get.docker.com lays
# down the engine and both plugins together. docker/docker-ce does the work (see
# install_bespoke, which puts it in front of its own plugins) and records the
# OUTCOME here -- empty, `ok` or `fail` -- so the two rows behind it can say what
# actually happened rather than claiming a success that never occurred. A
# recorded outcome rather than a re-probe, so a dry run prints the commands once
# instead of three times, and a broken network is not retried three times.
DOCKER_SCRIPTED=
# One private directory per run, for everything this script downloads.
#
@@ -615,8 +623,10 @@ apt_update_once() {
# That is what "apt-then-brew" has to mean in practice, and it is the difference
# between 34 packages installed and 0.
# `apt-cache show` is not an existence test. A name that exists only because
# something else Conflicts/Replaces it -- docker-ce on a stock Ubuntu is the
# live example -- prints nothing and exits 0, so the batch kept it, apt refused
# something else Conflicts/Replaces it, or that is published from a vendor
# repository nothing here configures -- nvidia-container-toolkit on a stock
# Ubuntu is the live example, and docker-ce was until the docker rows moved to
# get.docker.com -- prints nothing and exits 0, so the batch kept it, apt refused
# the whole batch with "has no installation candidate", and the brew column was
# never consulted. Ask for the installation candidate instead, which is the
# thing `apt-get install` will actually go looking for.
@@ -799,6 +809,15 @@ install_deb() {
install_bespoke() {
bsp=$(norm "$2")
[ -n "$bsp" ] || return 0
# The docker group is three rows and one install, and the row that performs
# it is the row the log should name. `keys` hands this list over sorted, so
# docker-buildx led and the engine appeared to be a consequence of its own
# plugin. Put the engine back in front of them.
# shellcheck disable=SC2086
case " $bsp " in
*" docker/docker-ce "*)
bsp="docker/docker-ce $(printf '%s\n' $bsp | grep -vx docker/docker-ce | tr '\n' ' ')" ;;
esac
head_ "$1"
for key in $bsp; do
case $key in
@@ -913,6 +932,118 @@ install_bespoke() {
# a failure invented by the dry run itself.
[ "$DRYRUN" -eq 1 ] || have brew \
|| note_fail "$key" "brew still not found after installing it" ;;
docker/docker-ce|docker/docker-buildx|docker/docker-compose)
# Docker publishes its own apt repository and ships nothing to
# Ubuntu's. `apt-cache policy docker-ce` on a stock box reports
# `Candidate: (none)`, so install_apt's unknown-name path fired and
# consulted the brew column — for a system daemon, on Linux. That is
# how brew got into the docker story at all, and it is why these
# rows are a script channel now: the vendor's own installer is the
# supported route, it configures the repository first, and it
# installs docker-ce, docker-ce-cli, containerd.io,
# docker-buildx-plugin AND docker-compose-plugin in a single pass.
#
# So the three rows are one install. The picker still shows three
# members and still carries the group's invasive warning, and
# `@needs gpu/container-toolkit docker` still pulls all three in —
# but docker/docker-ce is the row that runs it and the other two
# report ITS outcome. Saying "covered by" after a failed install
# would turn one honest failure into two invented successes.
#
# The compose that lands is the PLUGIN (`docker compose`). The
# standalone docker-compose v1 binary is deprecated and is never
# fetched, from apt, brew or anywhere else.
if [ -n "$DOCKER_SCRIPTED" ]; then
if [ "$DOCKER_SCRIPTED" = ok ]; then
say " $key: covered by the docker group's single install"
else
note_fail "$key" "not attempted — the docker install failed"
fi
continue
fi
# `have docker` on its own is a false proxy for this group. docker.io,
# podman-docker and a hand-dropped binary all satisfy it while
# shipping NEITHER plugin, so ticking the buildx or compose row would
# have quietly installed nothing. Ask for what the three rows between
# them deliver. A partial match is a reason to run the installer, not
# to skip it: the script upgrades and completes an existing install.
# Resolved through find_tool, like everything else here, because a
# docker installed a moment ago is not on this process's PATH.
if [ "$DRYRUN" -eq 0 ] && dk=$(find_tool docker) \
&& "$dk" buildx version >/dev/null 2>&1 \
&& "$dk" compose version >/dev/null 2>&1; then
say " docker with buildx and compose already present — leaving it"
DOCKER_SCRIPTED=ok; continue
fi
case $(uname -s) in
Darwin)
# No brew cask either. Docker Desktop's disk image carries an
# official CLI installer -- Contents/MacOS/install -- which is
# the documented unattended route and the only one that sets up
# the privileged helper without a human dragging an icon.
case $(uname -m) in
aarch64|arm64) a=arm64 ;;
x86_64|amd64) a=amd64 ;;
*) note_fail "$key" "no Docker Desktop build for $(uname -m)"
DOCKER_SCRIPTED=fail; continue ;;
esac
workdir || { note_fail "$key" "no private working directory"
DOCKER_SCRIPTED=fail; continue; }
# Same `[ -s ]` as the tarball handlers, and for the same
# reason: nothing reaches hdiutil that was not verified to have
# arrived. A truncated proxy error page mounts as garbage.
run_sh "curl -fsSL 'https://desktop.docker.com/mac/main/$a/Docker.dmg' -o '$WORKDIR/Docker.dmg' && [ -s '$WORKDIR/Docker.dmg' ]" \
|| { note_fail "$key" "Docker Desktop download failed or arrived empty"
DOCKER_SCRIPTED=fail; continue; }
# -mountpoint is the security-relevant flag here, not a tidiness
# one. Without it hdiutil mounts at /Volumes/Docker -- or at
# "/Volumes/Docker 1" when that name is already taken, and STILL
# exits 0. The installer line would then run whatever happens to
# be sitting at the fixed /Volumes/Docker, AS ROOT, and anyone
# able to mount an image gets to choose what that is. Mounting
# read-only inside this run's own 700 directory makes the thing
# that runs as root exactly the image just downloaded.
run_sh "hdiutil attach -nobrowse -readonly -quiet -mountpoint '$WORKDIR/mnt' '$WORKDIR/Docker.dmg'" \
|| { note_fail "$key" "could not mount Docker.dmg"
DOCKER_SCRIPTED=fail; continue; }
dk_rc=0
run_sh "${SUDO:+$SUDO }'$WORKDIR/mnt/Docker.app/Contents/MacOS/install' --accept-license" || dk_rc=1
# Detach whatever happened above, or the next run inherits a
# mount it did not make.
run_sh "hdiutil detach -quiet '$WORKDIR/mnt'" || warn "could not unmount $WORKDIR/mnt"
[ "$dk_rc" -eq 0 ] || { note_fail "$key" "the Docker Desktop installer failed"
DOCKER_SCRIPTED=fail; continue; }
DOCKER_SCRIPTED=ok ;;
*)
# NOT fetched straight into a shell through a pipe. POSIX sh has
# no pipefail, so that form exits with the SHELL's status: a
# download that 404s or dies half way through is a 0, note_fail
# is unreachable, and whatever fragment did arrive has already
# been executed as root. Download to a file this run owns, check
# it arrived non-empty, then run that file -- the same shape, and
# the same reason, as the three tarball handlers above.
workdir || { note_fail "$key" "no private working directory"
DOCKER_SCRIPTED=fail; continue; }
run_sh "curl -fsSL https://get.docker.com -o '$WORKDIR/get-docker.sh' && [ -s '$WORKDIR/get-docker.sh' ]" \
|| { note_fail "$key" "the Docker install script download failed or arrived empty"
DOCKER_SCRIPTED=fail; continue; }
# get.docker.com escalates on its own when it is not run as root,
# but this box may have no sudo at all and dotup already knows
# which -- so pass it explicitly and keep the command that is
# printed identical to the one that runs.
run_sh "${SUDO:+$SUDO }sh '$WORKDIR/get-docker.sh'" \
|| { note_fail "$key" "the official Docker install script failed"
DOCKER_SCRIPTED=fail; continue; }
DOCKER_SCRIPTED=ok ;;
esac
# core/brew's post-condition, for the same reason: an installer that
# exits 0 without leaving the binary behind is a failure THIS run
# should name, not one the next command stumbles into. Only after
# something actually ran -- under --print nothing did.
if [ "$DRYRUN" -eq 0 ] && [ "$DOCKER_SCRIPTED" = ok ] && ! have docker; then
note_fail "$key" "docker still not found after the installer ran"
DOCKER_SCRIPTED=fail
fi ;;
core/uv)
if have uv && [ "$DRYRUN" -eq 0 ]; then say " uv already present — leaving it"; continue; fi
run_sh "curl -LsSf https://astral.sh/uv/install.sh | sh" || note_fail "$key" "installer failed" ;;
+15 -3
View File
@@ -113,9 +113,17 @@ networking nfs-common invasive nfs-common - setuid mount helper
networking cifs-utils invasive cifs-utils - setuid mount helper
networking davfs2 invasive davfs2 - setuid mount helper
@docker daemon; membership in the docker group is root-equivalent
docker docker-ce invasive docker-ce - daemon; docker group is root-equivalent
docker docker-buildx invasive docker-buildx-plugin -
docker docker-compose invasive docker-compose-plugin -
# Docker's own apt repository, not Ubuntu's. `docker-ce`, `docker-buildx-plugin`
# and `docker-compose-plugin` live in download.docker.com/linux/<distro>, which
# nothing here configures — so on a stock box every one of these names had no
# installation candidate, install_apt's unknown-name path fired, and a Linux
# daemon went looking in the brew column. get.docker.com adds the repository and
# installs the engine and BOTH plugins in one pass, so all three rows are one
# install: see install_bespoke's docker branch. Never brew, and never the
# deprecated standalone docker-compose v1 — `docker compose` is the plugin.
docker docker-ce invasive -script -script daemon; docker group is root-equivalent · installs from get.docker.com, never brew
docker docker-buildx invasive -script -script buildx plugin — get.docker.com installs it alongside docker-ce
docker docker-compose invasive -script -script the compose plugin, run as `docker compose` — from get.docker.com, never the deprecated v1 binary
@desktop changes the display manager — can leave you at a black screen
desktop xfce4 invasive xfce4 - changes the display manager
desktop lightdm invasive lightdm - CAN LEAVE YOU AT A BLACK SCREEN
@@ -127,6 +135,10 @@ gpu container-toolkit invasive nvidia-container-toolkit - requires docker
virt qemu invasive qemu-kvm -
virt libvirt invasive libvirt-daemon-system - daemon + group membership
virt virt-manager invasive virt-manager -
# The rows above host guests; these two ARE the guest. Both ship in
# Ubuntu main — plain apt names, no vendor repository involved.
virt guest-agent invasive qemu-guest-agent - daemon the qemu HOST can command (shutdown, fsfreeze) — for when this box is the guest
virt spice-vdagent invasive spice-vdagent - guest clipboard/resolution under SPICE graphics · useless outside a VM
@private one password, typed after the install finishes
private private-repo private - - ~/.local/share/dotfiles-private — agent config, ssh config
private bws-secrets private - - bws + 7 API keys into ~/.config/zsh/secrets.zsh; the tier installs bws itself
Can't render this file because it contains an unexpected character in line 17 and column 49.