#OCI Labels vs Annotations
1 messages · Page 1 of 1 (latest)
👋 The answer is in the OCI image spec. https://github.com/opencontainers/image-spec/blob/main/annotations.md
and https://github.com/opencontainers/image-spec/blob/main/annotations.md#back-compatibility-with-label-schema specifically 🙏
Thanks. I've already read through the spec and followed the issues and PR on GitHub, but I'm still not seeing a practical explanation for why one would use labels over annotations beyond "corporate policies" and compatibility with Dockerfiles using the LABEL statement (aren't those the same as annotations? 😕). I'm curious - was Container.WithLabel mainly added for backwards compatibility? Would you recommend using Container.WithAnnotation exclusively in 2025?
This allows a user to add labels the Dockerfile build input Label { key: String! value: String! } type Directory { dockerBuild(dockerfile: String, platform: Platform, labels: [Label!]): Container! }