What is the LABEL instruction good for in Docker?
Experience Level: Senior
Tags: Docker
Answer
The LABEL instruction adds metadata to an image. A LABEL is a key-value pair. To include spaces within a LABEL value, use quotes and backslashes as you would in command-line parsing.
A few usage examples:
LABEL "com.example.vendor"="My Company"
LABEL com.example.label-with-value="foo"
LABEL version="1.0"
LABEL description="Label with multiple-line text \
is supported as well."
Related Docker job interview questions
What Docker instruction will you use to copy files from one layer to another layer when you are creating a Dockerfile?
Docker SeniorWhat instructions do you use in Dockerfile to a previous stage as a new stage?
Docker SeniorWhat is a difference between COPY and ADD instructions in Docker?
Docker SeniorWhat is the ADD instruction good for in Docker?
Docker SeniorWhat is the STOPSIGNAL instruction good for in Docker?
Docker Senior