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

+12 -1
View File
@@ -8,7 +8,8 @@
# FAKE_BOOT_PW the password that gets a 200; anything else gets a 401
# FAKE_BOOT_CODE force a code (404, 000, 500 ...) whatever the password
# FAKE_BWS_SUMS match (default) | mismatch | absent
# FAKE_FAIL=curl:deb | curl:chezmoi | curl:fzf fail just that one download
# FAKE_FAIL=curl:deb | curl:chezmoi | curl:fzf | curl:docker
# fail just that one download
_fb=$(dirname "$0") # the fakebin directory
url=; out=; prev=; readcfg=0
@@ -46,6 +47,16 @@ case $url in
installer chezmoi "\$HOME/.local/bin"; exit 0 ;;
*astral.sh/uv/install.sh*)
installer uv "\$HOME/.local/bin"; exit 0 ;;
*get.docker.com*)
# The vendor's convenience script. It installs the engine and both plugins
# in one pass, so the stand-in drops a single `docker` fake -- `docker
# buildx` and `docker compose` are subcommands of that binary, not separate
# ones. Through emit, because the caller downloads this to a file and runs
# the file rather than feeding it to a shell through a pipe: POSIX sh has no
# pipefail, so the pipe form cannot tell a failed download from a good one.
# FAKE_FAIL=curl:docker is that download failing.
[ "$mode" = docker ] && exit 22
installer docker "\$HOME/.local/bin" | emit; exit 0 ;;
*go.dev/VERSION*)
echo go1.99.0; exit 0 ;;
*api.github.com*)
+13 -5
View File
@@ -31,6 +31,10 @@
# saves the other thirty.
# FAKE_FAIL=npm:batch the same shape for npm.
# FAKE_FAIL=curl:deb curl fails only for the .deb download.
# FAKE_FAIL=curl:docker curl fails only for the get.docker.com script.
# That is how the docker group's failure path is
# reached: one note_fail, nothing executed, and
# the other two rows reported as not attempted.
#
# Several may be combined: FAKE_FAIL=brew,apt-get:batch
set -u
@@ -79,15 +83,19 @@ apt-cache)
#
# gh genuinely absent -- `apt-cache policy` prints nothing. The
# manifest's real example of a name that falls through to brew.
# docker-ce present in the cache but with `Candidate: (none)`, because
# something else Conflicts/Replaces it. `apt-cache show` exits
# 0 for this, which is why the old probe kept it in the batch
# and let apt refuse all thirty packages at once.
# nvidia-container-toolkit
# present in the cache but with `Candidate: (none)`: it is
# published from NVIDIA's own repository, which nothing here
# configures. `apt-cache show` exits 0 for this, which is why
# the old probe kept it in the batch and let apt refuse all
# thirty packages at once. (docker-ce used to be this example;
# the docker rows install from get.docker.com now and never
# reach apt at all, so the live case is NVIDIA's.)
case ${1:-} in
policy)
case ${2:-} in
gh) exit 0 ;;
docker-ce) printf '%s:\n Installed: (none)\n Candidate: (none)\n' "$2"; exit 0 ;;
nvidia-container-toolkit) printf '%s:\n Installed: (none)\n Candidate: (none)\n' "$2"; exit 0 ;;
esac
printf '%s:\n Installed: (none)\n Candidate: 1.0-fake\n' "$2"; exit 0 ;;
esac
+3 -1
View File
@@ -38,7 +38,9 @@ REAL='sh awk grep sed sort cut tr head tail id uname mkdir cp mv rm cat
# bws absent is what makes the private tier actually install it.
FAKE='curl apt-get apt-cache brew npm uv snap flatpak xcode-select
git dpkg unzip chezmoi'
OPTIONAL='sudo fzf bws nvim go node'
# docker absent is what makes the docker rows actually run get.docker.com;
# the fake the script drops behaves like every other one here.
OPTIONAL='sudo fzf bws nvim go node docker'
dir=${1:?usage: seal.sh <dir> [--with name ...] [--without name ...]}; shift
# Everything the seal KNOWS about, fixed before --without takes anything out: a
+161 -16
View File
@@ -401,6 +401,18 @@ is "…and the scoped mermaid name" "npm @mermaid-js/mermaid-cli" "$
is "deb channel carries a source" "deb gh:mkasberg/ghostty-ubuntu:_%a_%v.deb" "$(rs apps/ghostty)"
is "snap channel renames to the binary" "snap bw" "$(rs core/bitwarden-cli)"
is "tarball is dispatched, not named" "tarball neovim" "$(rs core/neovim)"
# The docker group. `docker-ce`, `docker-buildx-plugin` and
# `docker-compose-plugin` exist only in Docker's OWN apt repository, which
# nothing here configures — so as apt names they had no installation candidate,
# fell through to the brew column, and a system daemon went looking at Homebrew.
# They are a script row on both platforms now and never a formula.
is "docker is a script row, not an apt name" "script docker-ce" "$(rs docker/docker-ce)"
is "…the buildx plugin with it" "script docker-buildx" "$(rs docker/docker-buildx)"
is "…and compose, which is the plugin" "script docker-compose" "$(rs docker/docker-compose)"
# Guest tools for when this box is the VM, not the host. Ubuntu main, so these
# stay plain apt rows — the docker/nvidia vendor-repo trap does not apply.
is "the qemu guest agent is an apt row" "apt qemu-guest-agent" "$(rs virt/guest-agent)"
is "…and the spice agent beside it" "apt spice-vdagent" "$(rs virt/spice-vdagent)"
is "an unknown key says so" "missing" "$(rs nope/nope | tr -d ' ')"
# The macOS half of the manifest is exercised nowhere else. Resolution is pure
# data, so a fake `uname` is enough to check it — and it caught a real bug: the
@@ -412,6 +424,9 @@ is "darwin: tap-only pkg is a brew tap" "brew can1357/tap/omp" "$(drs agents/
is "darwin: zsh is built in" "builtin zsh" "$(drs core/zsh)"
is "darwin: no apt package is not a reason to try apt" "unavailable" \
"$(drs networking/davfs2 | tr -d ' ')"
# Docker Desktop's own CLI installer, off the .dmg. There is no brew cask in
# this story on either platform.
is "darwin: docker is a script row too" "script docker-ce" "$(drs docker/docker-ce)"
# Nothing in the default set may be unresolvable — that is a manifest bug, and
# it is silent until someone runs the installer on a fresh machine.
@@ -456,7 +471,7 @@ hasnt "--print never reaches the private stage" "Bootstrap URL:" "$out"
# handlers write outside $HOME, and a test suite has no business doing that.
newbox; BOXPATH=$SEALSUDO
pick agents/omp agents/specify-cli apps/obsidian core/bitwarden-cli \
core/gh core/lazygit core/mermaid-cli core/ripgrep docker/docker-ce
core/gh core/lazygit core/mermaid-cli core/ripgrep gpu/container-toolkit
box install >/dev/null 2>&1 || true
log=$(cat "$LOG")
has "apt batches its packages in one call" "apt-get install -y ripgrep" "$log"
@@ -472,13 +487,27 @@ has "…with the real obsidian app id" "md.obsidian.Obsidian"
# no installation candidate. The probe asks for the candidate now, so the
# assertion follows it.
has "apt probes before it batches" "apt-cache policy gh" "$log"
# docker-ce is here for one reason: it is in the apt cache but has no
# installation candidate, and `apt-cache show` exits 0 for exactly that shape.
# Under the old probe it stayed in the batch and apt refused all of them at
# once -- one unavailable name taking thirty installable ones down with it.
has "…and rejects a name with no candidate" "apt-cache policy docker-ce" "$log"
hasnt "…leaving it out of the apt batch" "apt-get install -y ripgrep docker-ce" "$log"
has "…while the rest of the batch survives" "apt-get install -y ripgrep" "$log"
# nvidia-container-toolkit is here for one reason: it is in the apt cache but
# has no installation candidate -- it ships from NVIDIA's own repository -- and
# `apt-cache show` exits 0 for exactly that shape. Under the old probe it stayed
# in the batch and apt refused all of them at once: one unavailable name taking
# thirty installable ones down with it. (docker-ce was this test's example until
# the docker rows moved to get.docker.com and stopped reaching apt at all.)
has "…and rejects a name with no candidate" "apt-cache policy nvidia-container-toolkit" "$log"
hasnt "…leaving it out of the apt batch" "apt-get install -y nvidia-container-toolkit" "$log"
# Asserted as the WHOLE line, not as a prefix. `has "apt-get install -y ripgrep"`
# passed for any batch that merely began with ripgrep, so a rejected name
# reappearing after it -- the exact regression this section exists to catch --
# would have gone unseen, and the assertion was pinned to sort order rather than
# to content. The brew prerequisite call is excluded by name because it is a
# second, deliberate apt line rather than a batch that split apart.
# The two leading words are stripped rather than asserted: $SUDO is empty for a
# run that is already root (the suite's own container is), so pinning them would
# make this pass on a laptop and fail in CI for a reason that is not the batch.
is "…while the rest of the batch survives, and only it" \
"apt-get install -y ripgrep" \
"$(grep 'apt-get install' "$LOG" | grep -v 'build-essential procps curl file git$' \
| sed 's/^sudo //; s/^DEBIAN_FRONTEND=noninteractive //')"
has "an apt name apt rejects moves to brew" "brew install gh" "$log"
hasnt "…and is not left in the apt batch" "apt-get install -y gh" "$log"
# npm cannot run before node, uv cannot run before uv. The pipeline is fixed
@@ -490,6 +519,92 @@ is "apt runs before npm" "yes" \
# Nothing runs as root that does not have to.
hasnt "brew is never run through sudo" "sudo brew" "$log"
printf '\n\033[1mdocker comes from Docker — never brew, never compose v1\033[0m\n'
# The group named docker-ce, docker-buildx-plugin and docker-compose-plugin as
# apt packages. All three live in download.docker.com/linux/<distro>, which
# nothing here configures, so on a fresh box apt had no candidate for any of
# them, install_apt's unknown-name path fired, and the brew column was consulted
# for a system daemon. Docker's convenience script is the vendor's supported
# route and lays down the engine and BOTH plugins in one pass.
newbox; BOXPATH=$SEALSUDO
pick docker/docker-ce docker/docker-buildx docker/docker-compose
out=$(box install --print 2>&1 | plain || true)
has "the group resolves to the official script" "get.docker.com" "$out"
is "…run once for three rows, not three times" "1" \
"$(printf '%s\n' "$out" | grep -c 'get.docker.com' || true)"
has "…and the rows it covers say so rather than going quiet" \
"docker/docker-compose: covered by the docker group's single install" "$out"
hasnt "no docker row reaches apt at all" "apt-get install -y docker" "$out"
# The line-by-line form of "never via brew": not one line of a full docker
# selection may name both.
is "no line of the docker plan pairs brew with docker" "" \
"$(printf '%s\n' "$out" | grep -i brew | grep -i docker || true)"
# v1 is a different program from the plugin, deprecated, and reachable from pip,
# apt and brew under the same hyphenated name. What lands is `docker compose`.
is "the deprecated standalone docker-compose is never fetched" "" \
"$(printf '%s\n' "$out" | grep -E 'install[^|]*docker-compose' || true)"
is "…nor named in either package-manager column" "" \
"$(awk -F'\t' '!/^[#@]/ && NF>=3 && ($4 ~ /docker-compose/ || $5 ~ /docker-compose/) {print}' "$M")"
# The real engine, against the seal. Two things about the setup are load-bearing.
#
# holed docker find_tool probes /usr/local/bin and /opt/homebrew/bin by
# ABSOLUTE path, which no PATH can seal. On a machine with
# Docker Desktop installed, the first run below would take the
# "already present" branch and every assertion here would pass
# or fail for a reason that has nothing to do with the code.
# `holed` refuses instead of pretending.
# no sudo SUDO='' means the vendor script is run directly, so the
# stand-in installer actually executes and drops a `docker`
# where find_tool will find it -- which is what makes the
# idempotence assertion below about something.
newbox
if holed docker; then
pick docker/docker-ce docker/docker-buildx docker/docker-compose
box install >/dev/null 2>&1 || true
has "the real run fetches the vendor script" "curl -fsSL https://get.docker.com" "$(cat "$LOG")"
is "…exactly once" "1" "$(grep -c 'get.docker.com' "$LOG" || true)"
is "…and never invokes brew for it" "" "$(grep -i brew "$LOG" || true)"
is "…nor a package manager for a docker name" "" \
"$(grep -E '^(apt-get|apt-cache|snap|flatpak|npm) .*docker' "$LOG" || true)"
# Idempotence. The script's stand-in installed to ~/.local/bin, one of
# find_tool's probes, so the second run sees it the way a real one would -- and
# what it asks is `docker buildx version` and `docker compose version`, not the
# mere existence of a `docker`: docker.io, podman-docker and a hand-dropped
# binary all satisfy that while shipping neither plugin, which would have made
# the two plugin rows silently do nothing.
out=$(box install 2>&1 | plain || true)
has "a second run leaves an installed docker alone" "already present — leaving it" "$out"
is "…and downloads nothing the second time" "1" "$(grep -c 'get.docker.com' "$LOG" || true)"
else
printf ' \033[33mskip\033[0m docker sits at an absolute path find_tool probes\n'
fi
# The failure path, and it is the one the pipe form could not reach: with no
# pipefail a failed download exited 0, note_fail was unreachable, and whatever
# fragment arrived had already run as root. Downloading to a file and checking
# it arrived is what makes any of this observable.
newbox
if holed docker; then
BOXENV='FAKE_FAIL=curl:docker'
pick docker/docker-ce docker/docker-buildx docker/docker-compose
out=$(box install 2>&1 | plain || true)
has "a failed download is reported, not swallowed" \
"the Docker install script download failed or arrived empty" "$out"
has "…against the key you can type at the picker" "docker/docker-ce" "$out"
is "…and the file that never arrived is never run" "" \
"$(printf '%s\n' "$out" | grep " sh '" || true)"
has "…and the other two rows say they were not attempted" \
"not attempted — the docker install failed" "$out"
is "…rather than claiming the install covered them" "" \
"$(printf '%s\n' "$out" | grep 'covered by the docker' || true)"
is "…having tried the download once, not once per row" "1" \
"$(grep -c 'get.docker.com' "$LOG" || true)"
is "…and the run exits non-zero" "1" "$(boxrc install)"
else
printf ' \033[33mskip\033[0m docker sits at an absolute path find_tool probes\n'
fi
printf '\n\033[1munattended — the boundary holds because of what is missing\033[0m\n'
# A stale state file is the adversary here: it ticks the two things an
# unattended run must never act on, and the run has to refuse both anyway.
@@ -563,10 +678,40 @@ is "…with brew's prerequisites as their own call" "1" \
"$(printf '%s\n' "$minprint" | grep -c 'build-essential procps curl file git$')"
unset minprint
rm -rf "$MIN"
# `sudo` must not be glued onto anything that is not a system package manager.
is "sudo is only ever used for apt, snap and dpkg" "" \
"$(grep -oE '\$\{SUDO:\+\$SUDO \}[a-z-]+' $D | sed 's/.*}//' | sort -u \
| grep -vE '^(apt-get|snap|rm|mkdir|tar|ln)$' || true)"
# `sudo` must not be glued onto anything that is not a system package manager or
# a file operation under a system prefix. Two vendor installers do have to run as
# root, and WHICH FILE each of them runs is the entire question -- so they are
# pinned below by name rather than allowlisted by shape.
#
# The old pattern stopped at `[a-z-]+`, which could not see an invocation
# beginning with a quote or a slash AT ALL: the macOS installer path was
# invisible to it, and so was any future one written that way. `[^ ]+` sees
# every one, and every one has to appear on this list.
sudoers() { grep -oE '\$\{SUDO:\+\$SUDO \}[^ ]+' $D | sed "s/.*}//; s/'//g" | sort -u; }
is "every root invocation is one of the ones we meant" "" \
"$(sudoers | grep -vxF -e apt-get -e rm -e mkdir -e tar -e ln -e sh \
-e DEBIAN_FRONTEND=noninteractive -e '$SNAP' \
-e '$WORKDIR/mnt/Docker.app/Contents/MacOS/install' || true)"
# `sh` is on that list for exactly one caller, and it must stay exactly one.
is "…exactly one root shell in the whole script" "1" \
"$(grep -cE '\$\{SUDO:\+\$SUDO \}sh ' $D || true)"
is "…and it runs this run's own copy of the vendor script" "1" \
"$(grep -cE '\$\{SUDO:\+\$SUDO \}sh .\$WORKDIR/get-docker\.sh.' $D || true)"
is "…which was downloaded to that file first" "1" \
"$(grep -cF 'curl -fsSL https://get.docker.com -o ' $D || true)"
# POSIX sh has no pipefail: a download fed straight to a root shell reports the
# SHELL's status, so a truncated body gets executed AND called a success.
# Nothing in this script may have that shape.
is "nothing is ever piped into a root shell" "" \
"$(grep -nE 'curl[^|]*\|[^|]*\$\{SUDO' $D || true)"
# The macOS root invocation, named. It runs out of this run's own 700 directory
# rather than /Volumes/Docker -- a fixed path anyone able to mount an image can
# occupy, and which hdiutil silently sidesteps to "/Volumes/Docker 1" while
# still exiting 0.
is "…and Docker Desktop's installer runs from this run's mount" "1" \
"$(grep -cE '\$\{SUDO:\+\$SUDO \}.\$WORKDIR/mnt/Docker\.app/Contents/MacOS/install.' $D || true)"
is "…which was mounted read-only at a path this run chose" "1" \
"$(grep -cE 'hdiutil attach .*-readonly .*-mountpoint .\$WORKDIR/mnt.' $D || true)"
printf '\n\033[1mthe seal itself — a missing fake is an error, not the host tool\033[0m\n'
SB1=${TMPDIR:-/tmp}/dotup-sealtest.$$; rm -rf "$SB1"; mkdir -p "$SB1"
@@ -627,13 +772,13 @@ newbox; pick core/ripgrep docker/docker-ce networking/openssh-server
out=$(box --unattended install 2>&1 | plain || true)
log=$(cat "$LOG")
has "it names what it refused" "refusing invasive packages" "$out"
hasnt "the daemon never reaches a package manager" "docker-ce" "$log"
hasnt "the daemon never reaches a package manager" "get.docker.com" "$log"
hasnt "…nor does the listening ssh port" "openssh-server" "$log"
has "…and the safe package still installs" "ripgrep" "$log"
# Conditional on the flag, or it is a broken installer rather than a boundary.
newbox; pick core/ripgrep docker/docker-ce
box install >/dev/null 2>&1 || true
has "with a human present the same tick does install" "docker-ce" "$(cat "$LOG")"
has "with a human present the same tick does install" "get.docker.com" "$(cat "$LOG")"
printf '\n\033[1mflags are read wherever they sit — DU-H1\033[0m\n'
# The production incident. The old parser stopped at the first bare word and
@@ -650,7 +795,7 @@ pick core/ripgrep docker/docker-ce networking/openssh-server
out=$(box install --unattended 2>&1 | plain || true)
log=$(cat "$LOG")
has "install --unattended refuses invasive too" "refusing invasive packages" "$out"
hasnt "…so the daemon never reaches a package manager" "docker-ce" "$log"
hasnt "…so the daemon never reaches a package manager" "get.docker.com" "$log"
hasnt "…nor does the listening ssh port" "openssh-server" "$log"
has "…and the safe package still installs" "ripgrep" "$log"
# A box where no selection has EVER existed: `install --unattended` must mean
@@ -661,7 +806,7 @@ newbox; BOXPATH=$SEALSUDO; rm -f "$SB/.config/dotfiles/selected"
out=$(box install --unattended 2>&1 | plain || true)
log=$(cat "$LOG")
has "no state file ever -> unattended install seeds the defaults" "ripgrep" "$log"
hasnt "…and the seeded defaults never include an invasive row" "docker-ce" "$log"
hasnt "…and the seeded defaults never include an invasive row" "get.docker.com" "$log"
newbox; BOXPATH=$SEALSUDO; : > "$SB/.config/dotfiles/picked"
out=$(box install --unattended 2>&1 | plain || true)
is "an accepted chose-none is a decision — nothing installs" "" "$(grep -E ' (install|remove|upgrade) ' "$LOG" || true)"