# Fixing Docker Hub authentication errors in GitHub Actions workflows

If you're encountering a Docker authentication error like ERROR: Error response from daemon: Head "<https://registry-1.docker.io/v2/moby/buildkit/manifests/buildx-stable-1>": unauthorized: incorrect username or password in your GitHub Actions workflows, this is typically caused by Docker Hub's rate limiting on anonymous pulls when using buildx. The error occurs when the docker/setup-buildx-action or similar buildx operations try to pull the moby/buildkit:buildx-stable-1 image from Docker Hub without authentication. Docker Hub has tightened rate limits for anonymous pulls, causing this authentication error. Quick Fix (Immediate Solution) To get your workflow running immediately, change your build action from type: buildx to type: docker :

* name: Build and Push Docker Image uses: duplocloud/actions/build-image\@v0.0.12 id: build-and-push with: repo: ${{ env.SERVICE\_NAME }} push: true type: docker cache: false This uses standard docker build instead of buildx, avoiding the need to pull the buildkit image from Docker Hub. Note that this disables some advanced buildx features like multi-platform builds and advanced caching, but works identically for single-platform builds. Long-term Solution (Recommended) For a permanent fix that maintains all buildx functionality, add Docker Hub authentication to your workflow: Create a free Docker Hub account for your organization Generate a Personal Access Token at <https://hub.docker.com/settings/security> Add the username and token as secrets in your GitHub repository Add a Docker Hub login step before your build step:
* name: Login to Docker Hub uses: docker/login-action\@v3 with: username: ${{ secrets.DOCKERHUB\_USERNAME }} password: ${{ secrets.DOCKERHUB\_TOKEN }}
* name: Build and Push Docker Image uses: duplocloud/actions/build-image\@v0.0.12 id: build-and-push with: repo: ${{ env.SERVICE\_NAME }} push: true type: buildx cache: false This approach provides authenticated pulls with much higher rate limits and maintains access to all buildx features. Apply to All Workflows Remember to apply whichever solution you choose to all workflows that use buildx, not just the one that's currently failing.
