Is `manifest list` what should be matched on for d...
# general
b
Is
manifest list
what should be matched on for docker image ids with container-d-snappshotting? I've noticed when building images with containerd-snapshotter and buildx that the image id is pulled from
manifest list
and changes everytime. Should the regex match for getting image_ids be on
manifest
instead? I'm not super familiar with these items so I could be doing something totally wrong. I noticed this when trying to track down why my caches were always missing with docker images. This could be an issue with newer versions of buildx as I'm still trying to figure out how to swap between versions. Code area I think: https://github.com/pantsbuild/pants/blob/680e6d29c954e691dde5ee5fbb9656e340b59552/src/python/pants/backend/docker/goals/package_image.py#L528
I see manifest can be duplicated if build platforms is more than 1. But that still leaves the problem of ever changing manifest list hash breaking caching. I'm exploring how that manifest list is generated now to see if maybe some options can stabilize it.
It seems to be related to the attestation manifest which contains provenance information. That's what's changing up the manifest list hash. I'm not sure if there's a way to disable it to get pants caching to work with it.
Potential solution is to configure buildx to use SBOM attest mode. Still exploring.
May have worked it in. I created a plugin to extend the `DockerImageTarget`with 2 new fields to set the
attest
build args. This seems to have fixed it. I still think something needs to be done in pants as the caching not working with containerd stuff is probably not intended.
n
I'm not sure I follow this entirely - but it's expected currently that docker images will be rebuilt on each
pants package
even if nothing changes, because Pants doesn't track the output (built images).
b
Yes docker images should be rebuilt each time. But the output image ID seems to be tracked by pants to know whether that target changed for downstream targets. With the recommended buildx settings, that ID can no longer be used for downstream caching.
s
@bland-cricket-38384 could you share the plugin? came here to report the same