From 031c3bdd41f93f20e6e048fd81585d6dc078d518 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Mar 2026 10:48:45 +0000 Subject: [PATCH] fix: defer podman system migrate to after the build to eliminate early downtime podman system migrate was stopping all containers immediately (visible in the terminal output as "stopped " lines), before the build even began. Moving it to just before compose down/up means running containers stay alive for the entire duration of the image build. https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH --- infra/start.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/infra/start.sh b/infra/start.sh index 5847040..650d818 100755 --- a/infra/start.sh +++ b/infra/start.sh @@ -127,8 +127,8 @@ fi if ! grep -q "^${_HIY_USER}:" /etc/subgid 2>/dev/null; then echo "${_HIY_USER}:100000:65536" | sudo tee -a /etc/subgid > /dev/null fi -# Migrate storage so Podman picks up the current subuid/subgid mappings. -podman system migrate +# NOTE: podman system migrate is intentionally deferred until just before +# compose up so that running containers stay alive during the image build. # ── Allow rootless processes to bind ports 80/443 ───────────────────────────── # Rootless Podman cannot bind privileged ports (<1024) by default. @@ -181,5 +181,8 @@ done make -C "$SCRIPT_DIR" build # ── Swap to new images (brief downtime starts here) ──────────────────────────── +# Migrate Podman storage to pick up current subuid/subgid mappings. +# Doing this here (not earlier) keeps running containers alive during the build. +podman system migrate podman compose --env-file "$REPO_ROOT/.env" -f "$SCRIPT_DIR/docker-compose.yml" down podman compose --env-file "$REPO_ROOT/.env" -f "$SCRIPT_DIR/docker-compose.yml" up -d