Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action v6 using --cache-from isn't compatible with latest docker buildx 0.20.0 #2942

Closed
3 tasks done
farvour opened this issue Jan 21, 2025 · 4 comments
Closed
3 tasks done
Assignees
Labels
area/build kind/bug Something isn't working
Milestone

Comments

@farvour
Copy link

farvour commented Jan 21, 2025

Contributing guidelines

I've found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

When trying to use this Action @v6 with the latest Docker Buildx 0.20.0, the --cache-from directive causes an error.

We are using a CSV list of values for cache-from which appear to get squashed together on a single --cache-from CSV. Whereas, the tag values are separated into separate --tag.

Expected behaviour

Buildx action builds with arguments properly.

Actual behaviour

Error: buildx failed with: ERROR: invalid value <REDACTED>.dkr.ecr.us-gov-west-1.amazonaws.com/app:git-000

Repository URL

No response

Workflow run URL

No response

YAML workflow

- name: Build, tag and push image to ECR - stage1
        uses: docker/build-push-action@v6
        with:
          context: "${{ steps.app-dockerfile-selector.outputs.context }}"
          file: "${{ steps.app-dockerfile-selector.outputs.dockerfile }}"
          target: stage1
          push: true
          tags: "${{ steps.docker-set-build-tags.outputs.tags }}" # < CSV list
          platforms: "${{ steps.docker-set-build-vals.outputs.platform }}"
          build-args: |
            BUILDKIT_INLINE_CACHE=1
            BUILD_GIT_SHA=${{ needs.prebuild.outputs.head-ref-short-sha }}
          cache-from: "${{ steps.docker-set-build-tags-cache-from.outputs.tags }}" # < CSV list

Workflow logs

No response

BuildKit logs


Additional info

Is it related to this? #2814

@farvour farvour changed the title Action v6 isn't compatible with latest docker buildx 0.20.0 Action v6 using --cache-from isn't compatible with latest docker buildx 0.20.0 Jan 21, 2025
@crazy-max
Copy link
Member

crazy-max commented Jan 21, 2025

Is it related to this? #2814

This might be related but without logs it's hard to figure out. Can you post the full logs of the Build, tag and push image to ECR - stage1 step please?

We are using a CSV list of values for cache-from which appear to get squashed together on a single --cache-from CSV

Fyi multiple cache-from entries for this input only supports the list format: https://github.com/docker/build-push-action?tab=readme-ov-file#inputs

Such as:

  cache-from: |
    type=registry,...
    type=gha,...

@crazy-max
Copy link
Member

Added tests in docker/build-push-action#1307 and can't repro. If you have a link to a repository with small repro or workflow logs that would help. Closing in the meantime.

@crazy-max
Copy link
Member

crazy-max commented Jan 22, 2025

After discussing internally this looks like an actual regression in Buildx 0.20.0, cache-from = "ref1,ref2" is a valid pattern.

@crazy-max crazy-max reopened this Jan 22, 2025
@crazy-max crazy-max transferred this issue from docker/build-push-action Jan 22, 2025
@crazy-max crazy-max added this to the v0.20.1 milestone Jan 22, 2025
@crazy-max
Copy link
Member

fixed in #2944

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants