LABEL 元数据
语法
# 添加元数据标签
LABEL maintainer="team@example.com"
LABEL version="1.0"
LABEL description="My application"
# 多个标签
LABEL org.opencontainers.image.source="https://github.com/user/repo" \
org.opencontainers.image.version="1.0.0" \
org.opencontainers.image.licenses="MIT"
OCI 标准
LABEL org.opencontainers.image.title="My App"
LABEL org.opencontainers.image.description="A sample app"
LABEL org.opencontainers.image.url="https://example.com"
LABEL org.opencontainers.image.source="https://github.com/user/repo"
查看标签
docker inspect --format='{{.Config.Labels}}' my-app
小结
| 指令 | 作用 |
|---|
LABEL | 添加元数据 |
org.opencontainers.image.* | OCI 标准标签 |