You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While you can use docker buildx build and specify a tag on the command line and push the image, then use the jf rt build-docker-create command to push the resulting images using the build-metadata file generated by the docker buildx bake command.
Simply create a docker-bake.hcl file like the following:
Now run the docker bake command: docker buildx bake --file docker-bake.hcl --metadata-file=build-metadata --push linux
Trying to run the jf rt build-docker-create <repository> --server-id=<server-id> --image-file build-metadata --build-name MyBuild --build-number 1 fails complaining about the presence of a image 256 sha sum.
Looking a bit further, the error message unexpected file format "build-metadata". The file should include one line in the following format: image-tag@sha256
Appears in the jfrog-cli-core project in artifactory/utils/container/buildinfo.go line 165. My guess is that this command doesn't take into account the build-metadata can be yet another sub-level deep e.g. wrapped with the "target" { ... } of the image. And even if it did, the list of tags inside the image.name property is a comma separated list.
When we do build of multiple containers, the docker buildx bake offers a contextual "inheritance" so to speak where you can use FROM base-image inside a secondary Dockerfile to model a "extends" without requiring this image to be tagged first. Also, being able to create multiple containers in one go is extremely useful to avoid the overhead of building each container by itself.
Maybe in the short term some magic using jq could help create multiple files on the fly by massaging the content of the meta-data file and then adding it, but it isn't apparent that multiple sequential executions of build-docker-create will append to each-other, so who knows... Re-writing my entire Jenkinsfile to support this seems silly at this point
Please consider this feature request soon.
The text was updated successfully, but these errors were encountered:
The underlying check (which I believe comes from the buildinfo repository?) needs to be updated to support the new provenance format, or something to that effect I believe.
Current workaround is to do something akin to (in a github action)
While you can use
docker buildx build
and specify a tag on the command line and push the image, then use thejf rt build-docker-create
command to push the resulting images using the build-metadata file generated by thedocker buildx bake
command.Simply create a docker-bake.hcl file like the following:
Then create two Dockerfile called Dockerfile and Dockerfile.java
Dockerfile
Dockerfile.java
Now run the docker bake command:
docker buildx bake --file docker-bake.hcl --metadata-file=build-metadata --push linux
Trying to run the
jf rt build-docker-create <repository> --server-id=<server-id> --image-file build-metadata --build-name MyBuild --build-number 1
fails complaining about the presence of a image 256 sha sum.Looking a bit further, the error message
unexpected file format "build-metadata". The file should include one line in the following format: image-tag@sha256
Appears in the jfrog-cli-core project in artifactory/utils/container/buildinfo.go line 165. My guess is that this command doesn't take into account the build-metadata can be yet another sub-level deep e.g. wrapped with the "target" { ... } of the image. And even if it did, the list of tags inside the image.name property is a comma separated list.
When we do build of multiple containers, the docker buildx bake offers a contextual "inheritance" so to speak where you can use FROM base-image inside a secondary Dockerfile to model a "extends" without requiring this image to be tagged first. Also, being able to create multiple containers in one go is extremely useful to avoid the overhead of building each container by itself.
Maybe in the short term some magic using
jq
could help create multiple files on the fly by massaging the content of the meta-data file and then adding it, but it isn't apparent that multiple sequential executions of build-docker-create will append to each-other, so who knows... Re-writing my entire Jenkinsfile to support this seems silly at this pointPlease consider this feature request soon.
The text was updated successfully, but these errors were encountered: