0

I have a github action setup to push to a private repo:

  -
        name: Login to DockerHub
        uses: docker/login-action@v2
        with:
          registry: ${{ secrets.REGISTRY_URL }}
          username: ${{ secrets.REGISTRY_USER }}
          password: ${{ secrets.REGISTRY_PASSWORD }}
      -
        name: Build and push
        uses: docker/build-push-action@v3
        with:
          push: true
          builder: ${{ steps.buildx.outputs.name }}
          tags: "${{ secrets.REGISTRY_URL }}/${{ steps.meta.outputs.tags }}"
          platforms: linux/arm64

when I run this, it succeeds (i.e. the container gets uploaded to the repo):

#17 [auth] sharing credentials for ***
#17 DONE 0.0s

#16 exporting to image
#16 pushing layers 1.9s done
#16 pushing manifest for ***/brotherlogic/gramophile-queue:0.233.0@sha256:5f1e054d06f136dac482afedf7d77b517a719623a48b7d8792cc352c755934f9
#16 pushing manifest for ***/brotherlogic/gramophile-queue:0.233.0@sha256:5f1e054d06f136dac482afedf7d77b517a719623a48b7d8792cc352c755934f9 0.3s done
#16 ...

but then it fails:


#18 [auth] brotherlogic/gramophile-queue:pull,push token for registry-1.docker.io
#18 DONE 0.0s

#16 exporting to image
#16 pushing layers 0.4s done
#16 ERROR: failed to push brotherlogic/gramophile-queue:0.233: failed to authorize: failed to fetch oauth token: unexpected status from GET request to https://auth.docker.io/token?scope=repository%3Abrotherlogic%2Fgramophile-queue%3Apull%2Cpush&service=registry.docker.io: 401 Unauthorized

I don't understand why it's trying to auth with auth.docker.io when I previously logged into the private repo?

Brother Logic
  • 286
  • 2
  • 9
  • Relevant: https://stackoverflow.com/questions/65361083/docker-build-failed-to-fetch-oauth-token-for-openjdk – Azeem Jul 27 '23 at 05:12

0 Answers0