docker icon indicating copy to clipboard operation
docker copied to clipboard

Add opencontainer labels to Docker images

Open RyanNgWH opened this issue 1 year ago • 2 comments

It would be great if the Docker container images had opencontainers labels. I have seen this across multiple other containers and believe this is the standard for labeling images.

https://github.com/opencontainers/image-spec/blob/main/annotations.md

Adding labels such as org.opencontainers.image.version will provide a way to obtain the current version of the running docker image which can be useful in automating the process of checking for updates.

Doing a docker inspect on the current images shows no labels. Here is an example of the Jellyfin docker image with opencontainers labels:

"Labels": {
    "org.opencontainers.image.description": "The Free Software Media System",
    "org.opencontainers.image.documentation": "https://jellyfin.org/docs/",
    "org.opencontainers.image.source": "https://github.com/jellyfin/jellyfin",
    "org.opencontainers.image.title": "Jellyfin",
    "org.opencontainers.image.url": "https://jellyfin.org",
    "org.opencontainers.image.version": "10.9.8"
}

RyanNgWH avatar Aug 23 '24 07:08 RyanNgWH

Looks like some of the other Docker Official program images support this. It would require changes to our update script and possibly Dockerfile templates I guess.

MariaDB image's approach:

  • https://github.com/MariaDB/mariadb-docker/blob/8b9a47d0544826a8fb7c01b4308b400c3f6e529f/update.sh#L73-L91
  • https://github.com/MariaDB/mariadb-docker/blob/8b9a47d0544826a8fb7c01b4308b400c3f6e529f/Dockerfile.template#L69-L79

For us the equivalent would be somewhere around here:

  • https://github.com/nextcloud/docker/blob/e6d024039fefe3d32ad1337ab318365259a5510c/update.sh#L106-L128
  • Debian
  • Alpine

joshtrichards avatar Aug 23 '24 13:08 joshtrichards

https://github.com/docker-library/official-images/issues/3540#issuecomment-530925319

This doesn't sound very encouraging

J0WI avatar Oct 24 '24 19:10 J0WI