buildx icon indicating copy to clipboard operation
buildx copied to clipboard

ERROR: failed to solve: unknown cache exporter: "s3"

Open hawkesn opened this issue 3 years ago • 1 comments

Currently running into this error via Github Actions:

ERROR: failed to solve: unknown cache exporter: "s3" 

My docker build step:

    - name: Build, tag, and push the image to Amazon ECR
      id: build-image
      working-directory: private/${{matrix.private-images}}
      env:
        ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
        ECR_REPOSITORY: ${{ matrix.private-images }}
        AWS_BUCKET: my_bucket_example
      run: |
        export DEFAULT_CACHE_OPTIONS="type=s3,region=$AWS_REGION,bucket=$AWS_BUCKET,name=$ECR_REPOSITORY,access_key_id=${{ secrets.AWS_ACCESS_KEY_ID }},secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }}"
          docker buildx build \
            --cache-from=$DEFAULT_CACHE_OPTIONS \
            --cache-to=$DEFAULT_CACHE_OPTIONS,mode=max \
            -t $ECR_REGISTRY/$ECR_REPOSITORY:${{steps.vars.outputs.sha_short}} \
            -t $ECR_REGISTRY/$ECR_REPOSITORY:${{github.sha}} \
            -t $ECR_REGISTRY/$ECR_REPOSITORY:$VERSION \
            -t $ECR_REGISTRY/$ECR_REPOSITORY:latest \
            --platform linux/amd64,linux/arm64 --push .

I'm installing buildx via:

docker/setup-buildx-action@v2
  with:
    version: latest
    driver: docker-container
    buildkitd-flags: --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
    install: false
    use: true

Docker version: 20.10.18+azure-1 BuildX version: github.com/docker/buildx v0.9.1 ed00243a0ce2a0aee75311b06e32d33b44729689 BuildKit version: builder-fe26a963-17b7-4995-bb65-aee8b34e545b0: moby/buildkit:buildx-stable-1 => buildkitd github.com/moby/buildkit v0.10.4 a2ba6869363812a210fcc3ded6926757ab780b5f

Any ideas what could be the problem? Let me know if there are other things I could test

hawkesn avatar Oct 12 '22 16:10 hawkesn

I don't think the s3 remote cache has been released in BuildKit yet; https://github.com/moby/buildkit/pull/2824. I think it's only in BuildKit master, not yet in the current (v0.10.x) release.

thaJeztah avatar Oct 12 '22 16:10 thaJeztah

Yup, @thaJeztah is correct.

See my response in https://github.com/docker/build-push-action/issues/647#issuecomment-1175186550 for some more information - you can use it today, but you will need to create a new buildx driver with a master build of buildkit.

jedevc avatar Oct 17 '22 15:10 jedevc