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

Setting tags not shown in the matrix example #19339

Closed
1 task done
andy5995 opened this issue Feb 8, 2024 · 8 comments
Closed
1 task done

Setting tags not shown in the matrix example #19339

andy5995 opened this issue Feb 8, 2024 · 8 comments

Comments

@andy5995
Copy link

andy5995 commented Feb 8, 2024

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

I can't find what I'm looking for

Description

In the example for the workflow using the matrix, setting the tags isn't shown.

Location

https://docs.docker.com/build/ci/github-actions/multi-platform/

Suggestion

Do the tags only need to be set in the meta section?

I'm trying this:

      -
        name: Docker meta
        id: meta
        uses: docker/metadata-action@v5
        with:
          images: ${{ env.REGISTRY_IMAGE }}
          tags: type=raw,value=dependencies-latest
-
        name: Build and push by digest
        id: build
        uses: docker/build-push-action@v5
        with:
          context: .
          file: ./dependencies.dockerfile
          platforms: ${{ matrix.platform }}
          labels: ${{ steps.meta.outputs.labels }}
          outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
          tags: ${{ steps.meta.outputs.tags }}

The build finishes but the push fails:

#15 exporting config sha256:702f28b89befc2ea0d12a904c3a353ccf80cb4be0d9770769b5839c9b997e53b done
#15 exporting attestation manifest sha256:65234ecf26b23171773d75ec90596e1d200641ca2e5d54a9a6ec327a2e7be124 done
#15 exporting manifest list sha256:e8b40fa8f621c7cd0a07cdafaaa3572809007aca2bcd2afc42a46cbeecf61800 done
#15 ERROR: failed to push ***/linuxdeploy:dependencies-latest: can't push tagged ref docker.io/***/linuxdeploy:dependencies-latest by digest
------
 > exporting to image:
------
ERROR: failed to solve: failed to push ***/linuxdeploy:dependencies-latest: can't push tagged ref docker.io/***/linuxdeploy:dependencies-latest by digest
Error: buildx failed with: ERROR: failed to solve: failed to push ***/linuxdeploy:dependencies-latest: can't push tagged ref docker.io/***/linuxdeploy:dependencies-latest by digest
@andy5995 andy5995 added the status/triage Needs triage label Feb 8, 2024
andy5995 added a commit to andy5995/linuxdeploy-build-helper-container that referenced this issue Feb 8, 2024
Seems to work now, after the previous commit to the dep workflow. I set
the tags only in the merge->meta section, as I noticed in this workflow
https://github.com/adap/flower/blob/3f757c7de94766784f15f14cfb0f8cec8566aa8a/.github/workflows/_docker-build.yml#L103

See also:

docker/docs#19339
@docker-robot
Copy link

docker-robot bot commented May 8, 2024

There hasn't been any activity on this issue for a long time.
If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

@andy5995
Copy link
Author

/remove-lifecycle stale

@andy5995
Copy link
Author

Here's a real-world workflow with the implementation. Note the "tags" section is only in the merge job.

@uZer
Copy link

uZer commented Jul 20, 2024

Hi!
I'm struggling with the same thing.
If we add tags, we get an error:

Error: buildx failed with: ERROR: invalid tag "xxx/yyy:zzz": invalid reference format
buildx failed with: ERROR: failed to solve: failed to push xxx/yyy:zzz: can't push tagged ref docker.io/xxx/yyy:zzz by digest

If we remove the tags to push-by-digest it fails with:

Error: buildx failed with: ERROR: tag is needed when pushing to registry

@docker-robot
Copy link

docker-robot bot commented Oct 18, 2024

There hasn't been any activity on this issue for a long time.
If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

@giordano
Copy link

giordano commented Nov 4, 2024

I think this is still an issue, following the example at https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners I still get the error reported at the top of the ticket

@andy5995
Copy link
Author

andy5995 commented Nov 4, 2024

/remove-lifecycle stale

@docker-robot
Copy link

docker-robot bot commented Dec 4, 2024

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

/lifecycle locked

@docker-robot docker-robot bot locked and limited conversation to collaborators Dec 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants