GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — v5.5.0 Broke docker/bake-action with docker-metadata-action · Issue #380 · docker/metadata-action

v5.5.0 Broke docker/bake-action with docker-metadata-action #380

Copy link
Copy link
Closed
#382
Closed
v5.5.0 Broke docker/bake-action with docker-metadata-action#380
#382
Copy link
Labels
kind/bug

Description

@mldmelissa
mldmelissa
opened on Jan 26, 2024
Issue body actions

Contributing guidelines

  • I've read the contributing guidelines and wholeheartedly agree

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

Bumping the version from 5.4.0 to 5.5.0 broke the usage of target "docker-metadata-action" {} with docker/bake-action@v4. When using 5.4.0, I was able to override the tags defined in my docker-bake.hcl file with the outputs of the docker/metadata-action, but now the tags no longer get overwritten with 5.5.0.

Expected behaviour

I would expect that if I have the following in my docker-bake.hcl file, the output of docker/[email protected] would override the tags defined in the targets.
``
target "docker-metadata-action" {}

target "_common" {
inherits = ["docker-metadata-action"]
}

target "example1" {
inherits = ["_common"]
tags = ["example1:latest"]
}
``

Actual behaviour

The outputs from docker/[email protected] do not override the tags defined in my docker-bake.hcl. When using v5.4.0 of docker/metadata-action, the tags were successfully overwritten.

Repository URL

No response

Workflow run URL

No response

YAML workflow

- name: Extract Docker metadata for data_manager
        id: meta
        uses: docker/[email protected]
        with:
          images: ${{ env.REGISTRY }}/${{ github.repository }}_${{ matrix.target }}
          tags: |
            type=schedule
            type=ref,event=branch
            type=ref,event=tag
            type=ref,event=pr
            type=raw,value=latest,enable={{is_default_branch}}
            type=sha
          bake-target: ${{ matrix.target }}
      - name: Build and push
        uses: docker/bake-action@v4
        with:
          targets: ${{ matrix.target }}
          files: |
            ${{ steps.meta.outputs.bake-file }}
            ./docker-bake.hcl
          push: true
          set: |
            *.cache-from=type=gha,scope=${{ matrix.target }}
            *.cache-to=type=gha,scope=${{ matrix.target }},mode=max

Workflow logs

No response

BuildKit logs

No response

Additional info

No response

Reacted by Eugene Kostjuk

Activity

  1. mldmelissa
    added
    status/triage
    on Jan 26, 2024
  2. ekostjuk commented on Jan 30, 2024

    @ekostjuk
    ekostjuk
    on Jan 30, 2024
    More actions

    Took me a while to land on this as it tries to use default registry for non-registry tagged images with 401, which is a red herring. Related error Error: buildx bake failed with: ERROR: failed to solve: failed to push ...: failed to authorize: failed to fetch oauth token: unexpected status from GET request to https://auth.docker.io/token?scope=repository ...

  3. mldmelissa commented on Jan 30, 2024

    @mldmelissa
    mldmelissa
    on Jan 30, 2024
    Author
    More actions

    Took me a while to land on this as it tries to use default registry for non-registry tagged images with 401, which is a red herring. Related error Error: buildx bake failed with: ERROR: failed to solve: failed to push ...: failed to authorize: failed to fetch oauth token: unexpected status from GET request to https://auth.docker.io/token?scope=repository ...

    I get that similar authorization failed message with trying to push, when this exact same workflow works with v5.4.0. I can see that it is trying to push my_container:latest, which it should be trying to push ghcr.io/my_org/my_container:pr-123@sha256:12345... I am not sure what changed to make it use the local "tags" field in the hcl file over the docker meta data.

    **#23 ERROR: failed to push my_container:latest: push access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

    exporting to image:

    ERROR: failed to solve: failed to push my_container:latest: push access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
    Error: buildx bake failed with: ERROR: failed to solve: failed to push my_container:latest: push access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed**

  4. crazy-max commented on Jan 31, 2024

    @crazy-max
    crazy-max
    on Jan 31, 2024
    Member
    More actions

    Yes this is similar to what has been reported in #370 (comment)

    It seems the merge logic of the bake definitions does not happen in the specified order when cwd:// prefix is used. I will make some changes in this action first and follow-up on buildx repo. Sorry for that.

    Reacted by Melissa White
  5. crazy-max
    added
    kind/bug
    and removed
    status/triage
    on Jan 31, 2024
  6. crazy-max
    closed this as completedin #382on Jan 31, 2024
  7. mldmelissa commented on Jan 31, 2024

    @mldmelissa
    mldmelissa
    on Jan 31, 2024
    Author
    More actions

    Yes this is similar to what has been reported in #370 (comment)

    It seems the merge logic of the bake definitions does not happen in the specified order when cwd:// prefix is used. I will make some changes in this action first and follow-up on buildx repo. Sorry for that.

    Awesome, thanks for working on that fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.