Add a pre-pull-docker-image composite action#101
Merged
Conversation
Current Aviator status
This PR was merged using Aviator (commit 9e5e864).
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
rjhuijsman
commented
Jul 10, 2026
Docker Hub intermittently returned 5xx errors that aborted `docker buildx` before it could resolve a build's base image, failing CI jobs before they ran any useful work; consumers had started hand-rolling pre-pull-with-retry steps inline in their workflows. Added a reusable composite action that pulls the image named by a Dockerfile's first `FROM` line into the runner's local image store, retrying transient failures with capped exponential backoff. A subsequent build in the same job using the default `docker` buildx driver then resolves the `FROM` image from the local store, keeping flaky registries off the build's critical path. The action is non-fatal: if every attempt fails it warns and exits successfully so the build can retry the pull itself. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UPXVU5ytyWJxSL4YChKhm6
b8b304a to
459dbd5
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a reusable composite GitHub Action (pre-pull-docker-image) that pre-pulls the base image referenced by the first FROM line of a Dockerfile, aiming to reduce CI flakiness from intermittent registry 5xx errors by warming the runner’s local Docker image store before subsequent docker build / docker buildx steps.
Changes:
- Introduces a new composite action that extracts the base image from a Dockerfile’s first
FROMline (skipping--platform-style options). - Adds retry logic with exponential backoff for
docker pull, and intentionally exits successfully even when retries are exhausted.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
onelxj
approved these changes
Jul 10, 2026
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.
Registries (Docker Hub included) intermittently returned 5xx errors that aborted
docker build/docker buildxbefore it could resolve a build's base image, failing CI jobs before they ran any useful work; we found ourselves doing a lot of manual re-runs for these casese.pre-pull-docker-imagefixes that class of flake in one shared place: it pulls an image into the runner's local image store with capped exponential backoff, so a later build in the same job (with the defaultdockerbuildx driver) resolves itsFROMimage locally instead of re-hitting a flaky registry. The image is parsed from the firstFROMline ofdockerfile;max-attemptsandinitial-delay-secondstune the retries. On exhaustion it warns and exits 0, leaving the build to retry the pull itself.This PR puts the reusable action in place, follow-on PRs in other repos will start using it.