-
Notifications
You must be signed in to change notification settings - Fork 151
Description
Assuming that docker/build-push-action#958 will be implemented, I hope annotations can be as well-supported as labels. That is, I wish in the JSON output would somehow contain one of the two values: either (for manifests)
org.opencontainers.image.created=...
org.opencontainers.image.description=...
org.opencontainers.image.licenses=...
org.opencontainers.image.revision=...
org.opencontainers.image.source=...
org.opencontainers.image.title=...
org.opencontainers.image.url=...
org.opencontainers.image.version=...
or (for indexes)
index:org.opencontainers.image.created=...
index:org.opencontainers.image.description=...
index:org.opencontainers.image.licenses=...
index:org.opencontainers.image.revision=...
index:org.opencontainers.image.source=...
index:org.opencontainers.image.title=...
index:org.opencontainers.image.url=...
index:org.opencontainers.image.version=...
However, I soon realized it is not easy to coherently extend the current UI to achieve this:
- Annotations can go anywhere, and for multi-arch images (arguably the most common use of indexes), at least ghcr.io specified that the annotations should go to the index. I'm not sure about other hosting services. Theoretically they can go anywhere.
- Buildkit will fail if there isn't an index for it to attach index annotations.
- It is not easy to predict whether Buildkit would generate an index; see Action started to push manifest indexes instead of images for a single platform build-push-action#755
Despite the above point 3, it seems one reasonable design is:
- A new option to tell
metadata-actionto generate those standard annotations for the index or the manifests (or maybe somewhere else?). - Another new option
annotationsfor the user to add or overwrite annotations.
I don't want to claim this is a very good design because of the above points 2 and 3. The user will have to know whether there would be an index layer to pick the correct options. On the other hand, it doesn't seem to make things worse, and I'd like to start this conversation now because the automatic metadata generation is arguably the last piece of a smooth pipeline on GitHub.