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
{{ message }}
Repository navigation
🐞 WithAnnotations does not work for multiarch images #10330
When including annotations on an image using WithAnnotation, I've found that annotations do not appear when publishing a multiarch image. From what I can tell annotations are supported by the image index spec. Not sure if would this be considered a Dagger or Buildkit issue?
Dagger version
v0.18.5
Steps to reproduce
Can't use the Dagger shell to reproduce, but here is a small module function which would demonstrate the issue:
Ah, so I suspect the annotations are actually appearing, but docker manifest is pretty much legacy at this point - it's not including any annotations (since it was built before OCI actually became a thing really).
Thanks @jedevc! Can confirm `docker manifest inspect omitted the platform-specific annotations. However, with this example below, I'm not able to see annotations for the image index itself.
This seems to be part of the OCI spec, but I'm not sure how broad the support for the annotations field in an image index is. It doesn't appear that the alpine image uses index-level annotations. Maybe it's too niche, but Is this something that could be supported in Dagger?
Yeah, the annotations we put are both on the manifest descriptor in the index, and on the manifest object itself - by design! We don't put them onto the index - curious what your use case is for that!
The reasoning is: Container.withAnnotation applies to a single-platform container-object - when you publish a multi-platform image, it wouldn't be correct to just merge all of those and put them on the top-level object. There's not really an obvious way to handle collisions, etc.
We have discussed previously what a multi-platform container would look like: #6675. Then it would make sense to have a MultiPlatformContainer.withAnnotation.
Activity
jedevc commentedon May 7, 2025
Ah, so I suspect the annotations are actually appearing, but
docker manifestis pretty much legacy at this point - it's not including any annotations (since it was built before OCI actually became a thing really).You can see this on
alpine:vs
docker buildxwhich does display this information:jedevc commentedon May 7, 2025
Closing, since I think the issue is with the command used to inspect the image.
But will re-open if the right command still doesn't include the right annotations, just let me know @cbochula! 💜
cbochula commentedon May 7, 2025
Thanks @jedevc! Can confirm `docker manifest inspect omitted the platform-specific annotations. However, with this example below, I'm not able to see annotations for the image index itself.
After calling, I see the
exampleannotation for thearm64andamd64platforms, but not seeing anannotationsfield for the image index itself:This seems to be part of the OCI spec, but I'm not sure how broad the support for the
annotationsfield in an image index is. It doesn't appear that the alpine image uses index-level annotations. Maybe it's too niche, but Is this something that could be supported in Dagger?jedevc commentedon May 12, 2025
Yeah, the annotations we put are both on the manifest descriptor in the index, and on the manifest object itself - by design! We don't put them onto the index - curious what your use case is for that!
The reasoning is:
Container.withAnnotationapplies to a single-platform container-object - when you publish a multi-platform image, it wouldn't be correct to just merge all of those and put them on the top-level object. There's not really an obvious way to handle collisions, etc.We have discussed previously what a multi-platform container would look like: #6675. Then it would make sense to have a
MultiPlatformContainer.withAnnotation.