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."

Comments

No Comments Yet.
Be the first to tell us what you think.
Docker instructions
Docker instructions

Are you learning Docker ? Try our test we designed to help you progress faster.

Test yourself