Skip to content

Conversation

avagin
Copy link
Contributor

@avagin avagin commented Apr 25, 2019

Docker container labels and OCI container annotations have the same meaning.

Annotations can be used by container runtime tools. For example, runc handles the org.criu.config annotation. Overall, it is a good way (only one?) to pass custom options to container runtime tools.

Links:
https://github.com/opencontainers/image-spec/blob/master/annotations.md
https://github.com/opencontainers/runc/blob/master/docs/checkpoint-restore.md

Signed-off-by: Andrei Vagin <avagin@google.com>
@cpuguy83
Copy link
Member

The reason this is not done is because at some point it was decided that labels are for higher-level tools (that is Docker API clients) and not for passing down configuration.
In such a case it would be docker that sets the annotation that the OCI runtime takes advantage of rather than a user directly setting it.

This of course all happened before OCI and annotations, etc.
containerd now uses labels heavily for configuration (as does k8s).... so maybe it's time to re-evaluate.

Does it make sense to pass down all labels? Can this cause some unexpected behaviors?

@thaJeztah
Copy link
Member

I think in previous discussions I was also wondering if Docker labels should be namespaced / prefixed to distinguish them from labels set at lower levels (e.g. com.docker.label.<name of label>=<value of label>)

@thaJeztah
Copy link
Member

Implemented (but slightly different) in #45025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants