> For the complete documentation index, see [llms.txt](https://camelgemonion.gitbook.io/docker/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://camelgemonion.gitbook.io/docker/dockercompose.yaml-wen-jian-zhong-chang-yong-zhi-ling/untitled-12/build/labels.md).

# labels

为镜像添加一些标签元数据。可以使用数组或字典形式来制定。

标签命名时推荐使用反向DNS命名法，防止与那些已经被其他软件使用的名称发送冲突。

```
 build:
   context: .
   labels:
     com.example.description: "Accounting webapp"
     com.example.department: "Finance"
     com.example.label-with-empty-value: ""
```

```
 build:
   context: .
   labels:
     - "com.example.description=Accounting webapp"
     - "com.example.department=Finance"
     - "com.example.label-with-empty-value"
```
