emulator: don't use docker image prune -a (would remove final image)

With -a, docker image prune removes every image that isn't referenced
by a running or stopped container. At this point in provisioning the
flatten container has been rm'd and stack.service is only enabled
(not started), so the freshly-tagged stack-local-emulator image has
zero container refs and was getting nuked. The VM then booted cleanly
but stack.service failed to `docker run` the image on startup,
producing a green systemd log with no services reachable on their
ports — the symptom we saw in the amd64 run.

Drop -a so we only prune dangling (untagged) images. The explicit
rmi of the fat + slim intermediates still leaves them dangling, so
they still get reclaimed.
This commit is contained in:
Bilal Godil 2026-04-13 12:18:43 -07:00
parent 7c44097140
commit 8146d359a8

View File

@ -405,7 +405,12 @@ write_files:
docker tag stack-local-emulator:final stack-local-emulator
docker rmi stack-local-emulator:final || true
docker builder prune -af || true
docker image prune -af || true
# Must be `prune -f` (dangling only), NOT `prune -af`. With -a, docker
# deletes every image that isn't referenced by a running/stopped
# container — at this point stack.service is only systemctl enable'd,
# not yet started, so the freshly-tagged stack-local-emulator image
# has zero container refs and would be nuked, bricking the final qcow2.
docker image prune -f || true
log "Intermediate images pruned."
log "Releasing free space for qcow2 compression (fstrim)..."