fix(build-rootfs): skip docker pull when the image is already local#250
Merged
Conversation
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) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
`build-rootfs.sh` unconditionally `docker pull`ed `$IMAGE` before exporting. For recipe-built local images that only exist on this host (the `coding-agent` recipe builds + tags `forkd-coding-agent:tmp-$$`), that pull is a needless registry round-trip — and behind a throttled registry mirror it returns 429 Too Many Requests and aborts the entire rootfs build.
Fix: `docker image inspect "$IMAGE" >/dev/null 2>&1 || docker pull -q "$IMAGE"` — use a local image as-is, only fetch genuinely-remote ones.
Found while re-baking the coding-agent hub asset (#242 follow-up); the bake failed three times on this exact 429 until patched. Also makes local / air-gapped `build-rootfs` runs mirror-independent.
Test plan
🤖 Generated with Claude Code