docker / buildx

Docker CLI plugin for extended build capabilities with BuildKit
Apache License 2.0
3.47k stars 467 forks source link

`imagetools create` should return the digest of the new image #2407

Open Pesa opened 5 months ago

Pesa commented 5 months ago

Description

I'm using docker buildx imagetools create to create a multi-platform image from previously built single-platform images.

I'd like this command to somehow output the digest of the newly created image, so that subsequent steps and downstream jobs can "atomically" operate (run some checks, inspect, sign, etc.) on that same version of the image without relying on tags, which can be moved.

docker/build-push-action already has a digest output, so I guess I'm asking for a similar feature in imagetools create.

tonistiigi commented 5 months ago

@crazy-max Should we add --metadata-file to imagetools create or do you have better ideas for UX. We can also do it for --dry-run that atm. prints the manifest bytes. Digest is just checksum of the same bytes.

crazy-max commented 3 weeks ago

@crazy-max Should we add --metadata-file to imagetools create or do you have better ideas for UX. We can also do it for --dry-run that atm. prints the manifest bytes. Digest is just checksum of the same bytes.

I think it would be enough to just print the digest imo. Not sure what else we could bring in the metadata file.

thompson-shaun commented 3 days ago

Let's move ahead with the suggestion from @tonistiigi