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>
| ... | ... |
@@ -373,9 +373,8 @@ blackslashes as you would in command-line parsing. |
| 373 | 373 |
LABEL "com.example.vendor"="ACME Incorporated" |
| 374 | 374 |
|
| 375 | 375 |
An image can have more than one label. To specify multiple labels, separate each |
| 376 |
-key-value pair by an EOL. |
|
| 376 |
+key-value pair with whitespace. |
|
| 377 | 377 |
|
| 378 |
- LABEL com.example.label-without-value |
|
| 379 | 378 |
LABEL com.example.label-with-value="foo" |
| 380 | 379 |
LABEL version="1.0" |
| 381 | 380 |
LABEL description="This text illustrates \ |
| ... | ... |
@@ -385,6 +384,8 @@ Docker recommends combining labels in a single `LABEL` instruction where |
| 385 | 385 |
possible. Each `LABEL` instruction produces a new layer which can result in an |
| 386 | 386 |
inefficient image if you use many labels. This example results in four image |
| 387 | 387 |
layers. |
| 388 |
+ |
|
| 389 |
+ LABEL multi.label1="value1" multi.label2="value2" other="value3" |
|
| 388 | 390 |
|
| 389 | 391 |
Labels are additive including `LABEL`s in `FROM` images. As the system |
| 390 | 392 |
encounters and then applies a new label, new `key`s override any previous labels |
| ... | ... |
@@ -392,6 +393,16 @@ with identical keys. |
| 392 | 392 |
|
| 393 | 393 |
To view an image's labels, use the `docker inspect` command. |
| 394 | 394 |
|
| 395 |
+ "Labels": {
|
|
| 396 |
+ "com.example.vendor": "ACME Incorporated" |
|
| 397 |
+ "com.example.label-with-value": "foo", |
|
| 398 |
+ "version": "1.0", |
|
| 399 |
+ "description": "This text illustrates that label-values can span multiple lines.", |
|
| 400 |
+ "multi.label1": "value1", |
|
| 401 |
+ "multi.label2": "value2", |
|
| 402 |
+ "other": "value3" |
|
| 403 |
+ }, |
|
| 404 |
+ |
|
| 395 | 405 |
## EXPOSE |
| 396 | 406 |
|
| 397 | 407 |
EXPOSE <port> [<port>...] |