LABEL
可以爲生成的鏡像添加元數據標籤信息,這些信息可以用來輔助過濾出特定鏡像
LABEL <key>=<value> <key>=<value> <key>=<value> ...
栗子一
# key 加了 "
LABEL "com.example.vendor"="ACME Incorporated"
# key 沒有 "
LABEL com.example.label-with-value="foo"
LABEL version="1.0"
# 換行
LABEL description="This text illustrates \
that label-values can span multiple lines."
栗子二
一行添加多個 key=value
LABEL multi.label1="value1" multi.label2="value2" other="value3"
等價寫法
LABEL multi.label1="value1" \
multi.label2="value2" \
other="value3"
通過 docker inspect 查看添加的元數據
> docker image inspect --format='' myimage
{
"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"
}