Update builder.md

Single value labels do not work in 1.6 and multi-label instructions only work when separated by non-EOL whitespace.
I also added an example snip from the inspect output with the labels that are included in this guide.

Signed-off-by: Jeff Nickoloff <jeff@allingeek.com>
This commit is contained in:
Jeff Nickoloff 2015-04-18 11:34:28 -07:00 committed by Jeff Nickoloff
parent 2bc3fb5149
commit 89df65be5d
1 changed files with 13 additions and 2 deletions

View File

@ -373,9 +373,8 @@ blackslashes as you would in command-line parsing.
LABEL "com.example.vendor"="ACME Incorporated"
An image can have more than one label. To specify multiple labels, separate each
key-value pair by an EOL.
key-value pair with whitespace.
LABEL com.example.label-without-value
LABEL com.example.label-with-value="foo"
LABEL version="1.0"
LABEL description="This text illustrates \
@ -385,6 +384,8 @@ Docker recommends combining labels in a single `LABEL` instruction where
possible. Each `LABEL` instruction produces a new layer which can result in an
inefficient image if you use many labels. This example results in four image
layers.
LABEL multi.label1="value1" multi.label2="value2" other="value3"
Labels are additive including `LABEL`s in `FROM` images. As the system
encounters and then applies a new label, new `key`s override any previous labels
@ -392,6 +393,16 @@ with identical keys.
To view an image's labels, use the `docker inspect` command.
"Labels": {
"com.example.vendor": "ACME Incorporated"
"com.example.label-with-value": "foo",
"version": "1.0",
"description": "This text illustrates that label-values can span multiple lines.",
"multi.label1": "value1",
"multi.label2": "value2",
"other": "value3"
},
## EXPOSE
EXPOSE <port> [<port>...]