Note Labels are key-value metadata stored in the image. They show up in docker inspect and can be used as filters: docker images --filter label=version=2.1. Use the OCI standard keys (org.opencontainers.image.*) for interoperability.
Frequently asked questions
How does Docker handle label image?
Docker covers this with 2 copy-ready snippets on this page. The "Tag an Image" snippet in Docker uses `docker tag <source_image>[:<tag>] <target_image>[:<tag>]`.
Which command does the Docker example use?
The "Tag an Image" snippet uses `docker tag <source_image>[:<tag>] <target_image>[:<tag>]`, from the Images section of the Docker cheat sheet.
What other Docker snippets are shown for "label image"?
Besides "Tag an Image", this page also shows "LABEL - Add Metadata".
Is there anything to watch out for?
Yes. For "Tag an Image": Tagging does not duplicate image layers - it just creates a new reference pointing to the same image ID. You can have many tags for one image.