docker-library / cassandra

Docker Official Image packaging for Cassandra
Apache License 2.0
262 stars 282 forks source link

Add OCI label org.opencontainers.image.source #260

Closed OuesFa closed 8 months ago

OuesFa commented 1 year ago

Proposal

Add the following OCI label org.opencontainers.image.source in the docker image to indicate the source repo URL.

Use case. I'm using Renovate to update dependencies. Renovate supports docker label org.opencontainers.image.source to point to source and add the release notes in the created PR. I would like to leverage that for cassandra images

I hope I'm on the right github repo for this need. FYI, I use a dockerfile with a simple FROM Example FROM cassandra:4.1.0

tianon commented 1 year ago

At some point, the build process in https://github.com/docker-library/official-images should be adding these as proper OCI annotations, which is how I'd prefer to solve this (especially since LABEL has unpleasant inheritance behavior).

OuesFa commented 1 year ago

Thanks for your answer.

Just to make sure I understand, what you are suggesting is not to add it in the Dockerfile of this repo but to add it elsewhere in a more generic way ? In the github actions workflow of https://github.com/docker-library/official-images?

If so, do you think it's something a newbie could make progress on? In which case I would be interested in a handy pointer to ease the task. Also, I'm not sure I understand what the problem is with the inheritance behavior? Is it that all images based on it would also have the org.opencontainers.image.source tag and that would be a problem?

tianon commented 1 year ago

For the first half, it would need to be part of bashbrew itself, and is going to be a much larger change (it really requires buildx/buildkit to implement OCI annotations, and then bashbrew to use them, which probably requires combining the build/push phases, so definitely not a small or easy task :grimacing:).

For the second half, yes, my main issue is that FROM cassandra:xxx will still include our label unless the image author overrides it (where many won't even be aware it's happening or understand why they should care).

OuesFa commented 1 year ago

Ok thank you for your answer.

So if i understand correctly this label will not be available in the cassandra image anytime soon. I might have to think of a workaround to include the release notes in the PRs that renovate will open to update the cassandra image versions in my dockerfiles.

tianon commented 8 months ago

This is fixed: https://explore.ggcr.dev/?image=cassandra:latest@sha256:8e6d9aa845c08f48be66ef57588fadc66c83a486fe98787d4c9724dda3eb1261