Skip to content

DevOps · CI/CD

CI Failed: Docker Hub 429 and Deploying from a Local Build

A production deploy failed at the build step because of an error unrelated to the code. I found the cause, wrote down the options for a permanent fix, and applied a safe local build flow that got the job done that day (5 images, about 22 minutes).

01. Symptom

The release script was tried twice. The "Build & Push" job on GitHub Actions ended in failure after about 3 minutes. The error in the log:

        failed to resolve source metadata for docker.io/library/golang:1.25-alpine:
429 Too Many Requests
      

02. Why

Docker Hub rate-limits anonymous image pulls coming from GitHub's shared runner IPs. So the problem isn't in the code, the migrations or network access. It fails while resolving the base image metadata, before the deploy step is even reached. The first job was to rule out "is this our fault?"; it wasn't.

03. Options

  1. 1
    Wait, then re-run only the failed jobsCheap, but with an unknown duration; the limit can last hours.
  2. 2
    Permanent fix: authenticated pulls in the workflowLog in with a Docker Hub token (as a secret) or use a mirror. It ends the problem at the root but is a separate change that needs secret management.
  3. 3
    What got the job done that day: build locallyI applied this so the deploy wouldn't wait; the permanent fix stayed as a separate task.

04. Tips for the local build flow

  • •A clean worktree. I built from a clean git worktree of HEAD, not from the working directory, so uncommitted or untracked files don't leak into the image. The price: changes must be committed and pushed first.
  • •One heavy process at a time. I built the five images one after another rather than in parallel, to avoid memory pressure and to keep it clear which one failed.
  • •An explicit target platform. Building for the server from an Apple Silicon machine without --platform linux/amd64 produces an image for the wrong architecture.
  • •Tags: latest + commit SHA. When a rollback is needed it is clear which image came from which code.
        # 1) Log in to GHCR (the token needs write:packages)
gh auth token | docker login ghcr.io -u <user> --password-stdin

# 2) Clean worktree from HEAD: keep uncommitted files out of the image
git worktree add --detach ../build-tmp "$(git rev-parse HEAD)"

# 3) Build + push the services one by one (one heavy process at a time)
for svc in app-backend dashboard-backend whatsapp app-frontend dashboard-frontend; do
  docker buildx build --platform linux/amd64 \
    -f infra/$svc.Dockerfile \
    -t ghcr.io/<user>/<repo>/$svc:latest \
    -t ghcr.io/<user>/<repo>/$svc:"$(git rev-parse --short HEAD)" \
    --push .
done

# 4) Trigger the deploy, verify, clean up
./scripts/release.sh --no-build
git worktree remove --force ../build-tmp
      
ImageTime
app-backend (Go)3 min
dashboard-backend (Go)2 min
whatsapp (Node sidecar)1 min
app-frontend (Nuxt)9 min
dashboard-frontend (Nuxt)7 min

05. Verification and cleanup

I verified that the deploy was really serving the new build with proof, not a guess: the frontend publishes its build ID in _nuxt/builds/latest.json, and the timestamp had to match the build time. Then I removed the worktree and shut down Docker. Returning the machine to how it started is part of the flow.

Takeaway: a deploy blocked by a third-party limit is not a code problem but a dependency-management problem. Separating the urgent fix from the permanent one and writing both down saves the first 10 minutes next time.

If you're looking for a developer, have a question, or just want to connect, feel free to reach out to me.

You can also find me on these platforms!

© 2026 · Designed and coded by Ahmet Ali Gül