Skip to content

fix: authenticate Docker Hub pulls to avoid CI rate limits - #476

Merged
c-vigo merged 1 commit into
devfrom
bugfix/473-dockerhub-buildx-ci
Apr 2, 2026
Merged

c-vigo merged 1 commit into
devfrom
bugfix/473-dockerhub-buildx-ci

Conversation

@c-vigo

@c-vigo c-vigo commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Description

Fix Docker Hub rate-limit failures on shared GitHub Actions runners. The docker/setup-buildx-action step pulls moby/buildkit from Docker Hub; anonymous pulls on shared runners hit rate limits, causing intermittent CI failures. This PR adds optional Docker Hub authentication to the build-image composite action and wires the credentials through ci.yml and release.yml.

Type of Change

  • feat -- New feature
  • fix -- Bug fix
  • docs -- Documentation only
  • chore -- Maintenance task (deps, config, etc.)
  • refactor -- Code restructuring (no behavior change)
  • test -- Adding or updating tests
  • ci -- CI/CD pipeline changes
  • build -- Build system or dependency changes
  • revert -- Reverts a previous commit
  • style -- Code style (formatting, whitespace)

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • .github/actions/build-image/action.yml — Added optional dockerhub-username and dockerhub-token inputs; added a Login to Docker Hub step (using docker/[email protected], SHA-pinned) that runs before setup-buildx-action when both inputs are provided; added documentation header explaining the Docker Hub auth rationale.
  • .github/workflows/ci.yml — Passed DOCKERHUB_USERNAME and DOCKERHUB_TOKEN secrets to the build-image action.
  • .github/workflows/release.yml — Same as ci.yml.
  • CHANGELOG.md / assets/workspace/.devcontainer/CHANGELOG.md — Added entry under ## Unreleased > ### Fixed.

Changelog Entry

Fixed

  • CI container build avoids shared-runner Docker Hub rate limits (#473)
    • build-image logs in to docker.io before setup-buildx-action when DOCKERHUB_USERNAME and DOCKERHUB_TOKEN secrets are set; ci.yml and release.yml pass them
    • Omitting secrets (e.g. forks) keeps prior anonymous-pull behavior

Testing

  • Tests pass locally (just test)
  • Manual testing performed (describe below)

Manual Testing Details

N/A — CI-only change; verified that the action YAML is syntactically valid via yamllint (pre-commit) and that check-action-pins passes for the new docker/login-action SHA pin.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (edit docs/templates/, then run just docs)
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

The new inputs default to empty strings, so forks or repos without DOCKERHUB_USERNAME / DOCKERHUB_TOKEN secrets simply skip the login step — identical to pre-PR behavior.

Refs: #473

- Add optional dockerhub-username/dockerhub-token inputs to build-image action
- Login to docker.io before setup-buildx-action when credentials are provided
- Pass DOCKERHUB_USERNAME and DOCKERHUB_TOKEN secrets in ci.yml and release.yml
- Forks without secrets retain anonymous-pull behavior

Refs: #473
@c-vigo c-vigo self-assigned this Apr 2, 2026
@c-vigo
c-vigo requested a review from Copilot April 2, 2026 11:38

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 mitigates intermittent CI failures caused by anonymous Docker Hub pull rate limits on GitHub-hosted runners by adding optional Docker Hub authentication to the repo’s image build path.

Changes:

  • Added optional dockerhub-username / dockerhub-token inputs to the build-image composite action and conditionally logs into Docker Hub before Buildx.
  • Wired DOCKERHUB_USERNAME / DOCKERHUB_TOKEN secrets through ci.yml and release.yml into the build-image action.
  • Documented the fix in both the root changelog and the workspace template changelog.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/actions/build-image/action.yml Adds optional Docker Hub login (SHA-pinned docker/login-action) before setup-buildx-action to reduce rate-limit failures.
.github/workflows/ci.yml Passes Docker Hub credentials (when available) into build-image during CI builds.
.github/workflows/release.yml Passes Docker Hub credentials into build-image for release builds.
CHANGELOG.md Records the CI fix under Fixed in Unreleased.
assets/workspace/.devcontainer/CHANGELOG.md Mirrors the changelog entry in the workspace template.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@c-vigo
c-vigo merged commit 9430a73 into dev Apr 2, 2026
15 checks passed
@c-vigo
c-vigo deleted the bugfix/473-dockerhub-buildx-ci branch April 2, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants