devcontainers / images

Repository for pre-built dev container images published under mcr.microsoft.com/devcontainers
https://containers.dev
MIT License
1.22k stars 448 forks source link

add opencontainers labels to the docker images #1053

Open mikaello opened 4 months ago

mikaello commented 4 months ago

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"
}
samruddhikhandale commented 4 months ago

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.

bamurtaugh commented 4 months ago

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

mikaello commented 4 months ago

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?

bamurtaugh commented 4 months ago

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/.

KuCoinEneko commented 3 months ago

https://containers.dev/