From e17ec1da758965e0c9d41df8179cda996de22234 Mon Sep 17 00:00:00 2001 From: Wayland Yang Date: Sun, 14 Jun 2026 22:52:41 +0800 Subject: [PATCH] fix(build-rootfs): skip docker pull when the image is already local MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit build-rootfs.sh unconditionally `docker pull`ed $IMAGE before creating the export container. For recipe-built wrapped images that exist only on this host (the coding-agent recipe tags one `forkd-coding-agent:tmp-$$`), that pull is a needless registry round-trip — and behind a throttled registry mirror it returns 429 and aborts the whole rootfs build. Guard the pull with `docker image inspect ... ||` so a local image is used as-is and only genuinely-remote images are fetched. Surfaced while re-baking the coding-agent hub asset (#242 follow-up); also makes every local/air-gapped build-rootfs run mirror-independent. Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/build-rootfs.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/build-rootfs.sh b/scripts/build-rootfs.sh index eadcd20..216d008 100644 --- a/scripts/build-rootfs.sh +++ b/scripts/build-rootfs.sh @@ -57,7 +57,12 @@ say "work dir: $WORK" # ---------------------------------------------------------------------------- say "[1/5] pulling + creating container..." -docker pull -q "$IMAGE" +# Skip the registry pull when the image already exists locally — e.g. a +# recipe-built wrapped image (coding-agent tags one as +# forkd-coding-agent:tmp-$$). Pulling such a local-only tag forces a +# needless registry round-trip that 429s behind a throttled mirror and +# aborts the build. +docker image inspect "$IMAGE" >/dev/null 2>&1 || docker pull -q "$IMAGE" docker create --name "$CONTAINER" "$IMAGE" /bin/true >/dev/null # ----------------------------------------------------------------------------