Skip to content

Ability to retrieve image IDs when using multiple exporters #3306

@cowwoc

Description

@cowwoc

Description

If I invoke docker buildx build --output type=docker --output type=oci,dest=oci.tar contextPath I should be able to add --iidfile or --metadata-file and have the generated files contain the image IDs of both images.

If you try this today, the generated files will contain one of the IDs but not the other.

I am expecting the generated files to contain both IDs and an indication of which exporter each one corresponds to.

Today, if I invoke the above command on this Dockerfile:

FROM scratch

COPY empty.txt .

I get this output:

[internal] load build definition from Dockerfile
	transferring 76/0 0.007
[internal] load .dockerignore
[internal] load build context
	transferring 2512/0 0.004
[1/1] COPY logback-test.xml .
exporting to oci image format
	exporting layers 0/0 0.058
	exporting manifest sha256:56b029f44ccd04d2f15a2b9ad39957f469c29fc880053750c2913ee09aab64bd 0/0 0.735
	exporting config sha256:fcbc65ed4feab765a528cdaa54b355b433dc6e4d86f29cc6dfc0a4ca20315110 0/0 0.004
	sending tarball 0/0 0.006
exporting to image
	exporting attestation manifest sha256:28f376eaa0ec7b68391b720540d177f6a1caacb59b020bdc8bec92c91845688f 0/0 0.018
	exporting manifest list sha256:3f4a3acab60068864e10ec341ef83a418edfd355185bd70d792be8c719eccc51 0/0 0.01
	naming to moby-dangling@sha256:3f4a3acab60068864e10ec341ef83a418edfd355185bd70d792be8c719eccc51 0/0 0.003
	unpacking to moby-dangling@sha256:3f4a3acab60068864e10ec341ef83a418edfd355185bd70d792be8c719eccc51 0/0 0.018

The OCI and Docker images have different IDs. I'd like to be able to look then up without parsing the console output.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions