docker buildx build --metadata-file buildmeta.json -t myapp .

Category: Docker

docker buildx build --metadata-file buildmeta.json -t myapp .

Write build metadata to a JSON file

metadata-file emits a JSON document with the built image's ID, digest, and refs (digest = a content hash uniquely identifying the image). CI pipelines parse this file to deploy the exact artifact instead of guessing tags. Add --push to also publish to a registry.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.