Skip to content

Add a pre-pull-docker-image composite action#101

Merged
aviator-app[bot] merged 2 commits into
mainfrom
rjh.pre-pull-docker-image
Jul 10, 2026
Merged

Add a pre-pull-docker-image composite action#101
aviator-app[bot] merged 2 commits into
mainfrom
rjh.pre-pull-docker-image

Conversation

@rjhuijsman

@rjhuijsman rjhuijsman commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Registries (Docker Hub included) intermittently returned 5xx errors that aborted docker build / docker buildx before 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-image fixes 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 default docker buildx driver) resolves its FROM image locally instead of re-hitting a flaky registry. The image is parsed from the first FROM line of dockerfile; max-attempts and initial-delay-seconds tune 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.

@aviator-app

aviator-app Bot commented Jul 10, 2026

Copy link
Copy Markdown

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

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.

Comment thread pre-pull-docker-image/action.yml Outdated
Comment thread pre-pull-docker-image/action.yml Outdated
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
@rjhuijsman rjhuijsman force-pushed the rjh.pre-pull-docker-image branch from b8b304a to 459dbd5 Compare July 10, 2026 10:07
@rjhuijsman rjhuijsman requested a review from Copilot July 10, 2026 11:07
@rjhuijsman rjhuijsman marked this pull request as ready for review July 10, 2026 11:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 FROM line (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.

Comment thread pre-pull-docker-image/action.yml
Comment thread pre-pull-docker-image/action.yml
@aviator-app aviator-app Bot merged commit 9e5e864 into main Jul 10, 2026
1 check failed
@aviator-app aviator-app Bot deleted the rjh.pre-pull-docker-image branch July 10, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants