mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 00:47:48 +08:00
docs: add levels to bake file target.annotations
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> (cherry picked from commit c6535e967596414f83d627e89439682b1f77b68a)
This commit is contained in:
parent
ba1ee7af6e
commit
2175f9ec7c
@ -274,13 +274,13 @@ target "db" {
|
||||
|
||||
### `target.annotations`
|
||||
|
||||
The `annotations` attribute is a shortcut to allow you to easily set a list of
|
||||
annotations on the target.
|
||||
The `annotations` attribute lets you add annotations to images built with bake.
|
||||
The key takes a list of annotations, in the format of `KEY=VALUE`.
|
||||
|
||||
```hcl
|
||||
target "default" {
|
||||
output = ["type=image,name=foo"]
|
||||
annotations = ["key=value"]
|
||||
annotations = ["org.opencontainers.image.authors=dvdksn"]
|
||||
}
|
||||
```
|
||||
|
||||
@ -288,10 +288,25 @@ is the same as
|
||||
|
||||
```hcl
|
||||
target "default" {
|
||||
output = ["type=image,name=foo,annotation.key=value"]
|
||||
output = ["type=image,name=foo,annotation.org.opencontainers.image.authors=dvdksn"]
|
||||
}
|
||||
```
|
||||
|
||||
By default, the annotation is added to image manifests. You can configure the
|
||||
level of the annotations by adding a prefix to the annotation, containing a
|
||||
comma-separated list of all the levels that you want to annotate. The following
|
||||
example adds annotations to both the image index and manifests.
|
||||
|
||||
```hcl
|
||||
target "default" {
|
||||
output = ["type=image,name=foo"]
|
||||
annotations = ["index,manifest:org.opencontainers.image.authors=dvdksn"]
|
||||
}
|
||||
```
|
||||
|
||||
Read about the supported levels in
|
||||
[Specifying annotation levels](https://docs.docker.com/build/building/annotations/#specifying-annotation-levels).
|
||||
|
||||
### `target.attest`
|
||||
|
||||
The `attest` attribute lets you apply [build attestations][attestations] to the target.
|
||||
|
Loading…
x
Reference in New Issue
Block a user