Skip to content

V6 broke interaction with docker/metadata-action #287

Closed

Description

@davhdavh

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

existing build scripts using docker/metadata-action are failing with v6 due to confusion about where the files are located

Expected behaviour

build success

Actual behaviour

ERROR: failed to solve: lstat /actions-runner/_work/_temp/docker-actions-toolkit-YZDiwT/docker-metadata-action-bake.json: no such file or directory

Repository URL

No response

Workflow run URL

No response

YAML workflow

- name: Docker meta
      id: meta-yyy
      uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5
      with:
        images: |
          ${{ secrets.DOCKER_USERNAME }}/xxx
        flavor: |
          latest=false
          prefix=yyy-
        tags: |
          type=raw,value=${{ github.run_number }}
        labels: |
          org.opencontainers.image.title=xxx
          org.opencontainers.image.description=xxx
          org.opencontainers.image.vendor=xxx
        bake-target: yyy-tags

    - name: Build
      uses: docker/bake-action@60f5d53310314dbf8c33f0c8a01042536f2f6c36 # v6
      with:
        files: |
          ./docker-bake.json
          ${{ steps.meta-yyy.outputs.bake-file }}
        targets: default
        push: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate') }}
        pull: true #always pull latest version of base images of whatever we are building

Workflow logs

No response

BuildKit logs


Additional info

No response

Activity

  1. crazy-max commented on Jan 20, 2025

    @crazy-max
    Member

    As v6 is now using Git context by default (https://github.com/docker/bake-action/releases/tag/v6.0.0), it needs some changes in the metadata-action step: https://github.com/docker/metadata-action?tab=readme-ov-file#bake-definition

    You need to use the local bake file by specifying the cwd:// prefix when building with a git context, otherwise it will try to look at this file within the git repo.

    In your case:

        - name: Build
          uses: docker/bake-action@60f5d53310314dbf8c33f0c8a01042536f2f6c36 # v6
          with:
            files: |
              ./docker-bake.json
              cwd://${{ steps.meta-yyy.outputs.bake-file }}
            targets: default
            push: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate') }}
            pull: true #always pull latest version of base images of whatever we are building

    More info: https://docs.docker.com/build/bake/remote-definition/#combine-local-and-remote-bake-definitions

    I will update the release notes.

  2. davhdavh commented on Jan 20, 2025

    @davhdavh
    Author

    Thanks that work...

  3. added a commit that references this issue on Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions