action-kaniko icon indicating copy to clipboard operation
action-kaniko copied to clipboard

Cache does not work with ghcr.io tries to push to docker.io

Open absmith82 opened this issue 3 years ago • 1 comments

When I try and use cache with ghcr.io it sends a warning and doesn't cache the build

WARN[0212] error uploading layer to cache: failed to push to destination cache-image:: HEAD https://index.docker.io/v2/library/cache-image/blobs/: unexpected status code 401 Unauthorized (HEAD responses have no body, use GET for details)

env:
  # Use docker.io for Docker Hub if empty
  REGISTRY: ghcr.io
  # github.repository as <account>/<repo>
  IMAGE_NAME: ${{ github.repository }}
jobs:
  build:
    name: Build with Kaniko
    runs-on: self-hosted
    steps:
      - id: image_name
        name: image_name
        uses: ASzc/change-string-case-action@v1
        with:
          string: ${{ github.repository }}
      - uses: actions/checkout@master
      - name: Kaniko build
        uses: aevea/action-kaniko@master
        with:
          registry: ${{ env.REGISTRY }}
          image: ${{ steps.image_name.outputs.lowercase }}
          password: ${{ secrets.GITHUB_TOKEN }}
          cache: true
          cache_registry: cache-image
          tag: develop
          build_file: docker/Dockerfile

absmith82 avatar Sep 28 '21 23:09 absmith82

@aexvir don't know if you saw this one.

fallion avatar Oct 23 '21 20:10 fallion