LABEL
The Dockerfile instruction that attaches key-value notes, such as the source repository or version, to an image.
In more detail
Labels are metadata only. The OCI annotation keys, such as org.opencontainers.image.source, let registries and scanners link an image back to its code. A label is a note, not a guarantee: anyone can write any value.
Example
LABEL org.opencontainers.image.source="https://github.com/example/taskapi"Related terms
- metadata — Data that describes other data, such as a file name, a creation time or a package version.
- OCI image specification — The standard that defines what an image is: layers, a configuration and a manifest, all addressed by digest.
Taught in
- ARG, ENV, LABEL, EXPOSE And VOLUME — Docker Architecture & Production Containers
- Twelve Lines, Ten Warnings: Dockerfile Instructions And hadolint — Docker Certified Associate (DCA) Exam Prep