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

Build is not getting published when using docker buildx metadata file with multiple tags #2846

Open
galusben opened this issue Jan 27, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@galusben
Copy link
Contributor

Describe the bug

When using the command rt build-docker-create and providing an image file, if the image file contains multiple tags the build will not get published.

Example:
Docker build with metadata output file:
docker buildx build --pull --push --metadata-file=build-metadata --platform linux/arm64,linux/amd64 -t myorg.jfrog.io/myrepo/jfrog/myimage:tag1 -t myorg.jfrog.io/myrepo/jfrog/myimage:tag2 -f Dockerfile .

build-docker-create:
jf rt build-docker-create repo --image-file build-metadata --build-name mybuild --build-number 1

Output the error
11:57:17 [Error] Could not find docker image in Artifactory, expecting image tag: myorg.jfrog.io/myrepo/jfrog/myimage:tag1,myorg.jfrog.io/myrepo/jfrog/myimage:tag2

This is because the metadata file will contain a field image.name with comma separated list of tags (probably not a great decision by docker, the better solution would have been to use an array, but it is what it is) and the jfrog cli parse it as it, and expect this to be a single image name.

Current behavior

11:57:17 [Error] Could not find docker image in Artifactory, expecting image tag: myorg.jfrog.io/myrepo/jfrog/myimage:tag1,myorg.jfrog.io/myrepo/jfrog/myimage:tag2

Reproduction steps

Docker build with metadata output file:
docker buildx build --pull --push --metadata-file=build-metadata --platform linux/arm64,linux/amd64 -t myorg.jfrog.io/myrepo/jfrog/myimage:tag1 -t myorg.jfrog.io/myrepo/jfrog/myimage:tag2 -f Dockerfile .

build-docker-create:
jf rt build-docker-create repo --image-file build-metadata --build-name mybuild --build-number 1

Output the error
11:57:17 [Error] Could not find docker image in Artifactory, expecting image tag: myorg.jfrog.io/myrepo/jfrog/myimage:tag1,myorg.jfrog.io/myrepo/jfrog/myimage:tag2

Expected behavior

No error and the build will get published later with the publish command and have all the data.

JFrog CLI version

2.73.2

Operating system type and version

Linux Ubuntu 20

JFrog Artifactory version

SaaS

JFrog Xray version

No response

@galusben galusben added the bug Something isn't working label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant