images icon indicating copy to clipboard operation
images copied to clipboard

add opencontainers labels to the docker images

Open mikaello opened this issue 1 year ago • 5 comments

Request: Make the published docker images contain org.opencontainers.image.source label for easy reference back to this repository when the image gets updates. This is useful for tools like Renovate that makes updates to repositories when this image gets updates. OCI has standardized a few labels for adding metadata to images: https://github.com/opencontainers/image-spec/blob/main/annotations.md

You have currently a few labels already, but it would have been nice if the mentioned org.opencontainers.image.source label were added, and preferable also the other standardized labels.

Example of labels in javascript-node:

$ docker pull mcr.microsoft.com/devcontainers/javascript-node:latest
$ docker inspect mcr.microsoft.com/devcontainers/javascript-node:latest --format '{{ json .Config.Labels }}'

Output:

{
  "dev.containers.id": "javascript-node",
  "dev.containers.release": "v0.3.36",
  "dev.containers.source": "https://github.com/devcontainers/images",
  "dev.containers.timestamp": "Tue, 07 May 2024 23:52:33 GMT",
  "dev.containers.variant": "22-bookworm",
  "devcontainer.metadata": "[ {\"id\":\"ghcr.io/devcontainers/features/common-utils:2\"}, {\"id\":\"ghcr.io/devcontainers/features/git:1\"}, {\"id\":\"ghcr.io/devcontainers/features/node:1\",\"customizations\":{\"vscode\":{\"extensions\":[\"dbaeumer.vscode-eslint\"]}}}, {\"customizations\":{\"vscode\":{\"extensions\":[\"dbaeumer.vscode-eslint\"]}},\"remoteUser\":\"node\"} ]",
  "version": "1.1.0"
}

mikaello avatar May 08 '24 12:05 mikaello

Hi 👋

With the migration of the Dev Containers Spec to an Open Spec, I believe the Dev Container Images can also be standardized by the Open Containers Initiative (OCI).

Hence, I think it makes sense to add some well-perceived labels to the images we publish from this repo

Looping in @bamurtaugh @craiglpeters for any other thoughts.

samruddhikhandale avatar May 09 '24 00:05 samruddhikhandale

Thanks for opening this issue and for looping me in! I agree with what's been mentioned so far.

bamurtaugh avatar May 09 '24 18:05 bamurtaugh

Thanks both of you for your fast acknowledgement.

I try to keep up to date with the development of features and the community, but haven't heard of "Open Spec" before, do you have any pointers/references to more information on that migration?

mikaello avatar May 09 '24 20:05 mikaello

haven't heard of "Open Spec" before, do you have any pointers/references to more information on that migration?

Apologies for lack of clarity! We just mean that dev containers are an open source specification. You can explore all the repos part of the spec in the devcontainers org on GitHub, and read more about our work on https://containers.dev/.

bamurtaugh avatar May 09 '24 20:05 bamurtaugh

https://containers.dev/

KuCoinEneko avatar May 13 '24 11:05 KuCoinEneko