docker
docker copied to clipboard
Add opencontainer labels to Docker images
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"
}
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/docker-library/official-images/issues/3540#issuecomment-530925319
This doesn't sound very encouraging