Skip to content

Commit cacb4fb

Browse files
authored
Merge pull request #2953 from dvdksn/docs-bake-composable-attrs
docs: update bake reference to use composable attrs
2 parents a115073 + df80bd7 commit cacb4fb

File tree

1 file changed

+30
-20
lines changed

1 file changed

+30
-20
lines changed

docs/bake-reference.md

+30-20
Original file line numberDiff line numberDiff line change
@@ -285,27 +285,19 @@ The key takes a list of annotations, in the format of `KEY=VALUE`.
285285

286286
```hcl
287287
target "default" {
288-
output = ["type=image,name=foo"]
288+
output = [{ type = "image", name = "foo" }]
289289
annotations = ["org.opencontainers.image.authors=dvdksn"]
290290
}
291291
```
292292

293-
is the same as
294-
295-
```hcl
296-
target "default" {
297-
output = ["type=image,name=foo,annotation.org.opencontainers.image.authors=dvdksn"]
298-
}
299-
```
300-
301293
By default, the annotation is added to image manifests. You can configure the
302294
level of the annotations by adding a prefix to the annotation, containing a
303295
comma-separated list of all the levels that you want to annotate. The following
304296
example adds annotations to both the image index and manifests.
305297

306298
```hcl
307299
target "default" {
308-
output = ["type=image,name=foo"]
300+
output = [{ type = "image", name = "foo" }]
309301
annotations = ["index,manifest:org.opencontainers.image.authors=dvdksn"]
310302
}
311303
```
@@ -321,8 +313,13 @@ This attribute accepts the long-form CSV version of attestation parameters.
321313
```hcl
322314
target "default" {
323315
attest = [
324-
"type=provenance,mode=min",
325-
"type=sbom"
316+
{
317+
type = "provenance",
318+
mode = "max",
319+
},
320+
{
321+
type = "sbom",
322+
}
326323
]
327324
}
328325
```
@@ -338,8 +335,15 @@ This takes a list value, so you can specify multiple cache sources.
338335
```hcl
339336
target "app" {
340337
cache-from = [
341-
"type=s3,region=eu-west-1,bucket=mybucket",
342-
"user/repo:cache",
338+
{
339+
type = "s3",
340+
region = "eu-west-1",
341+
bucket = "mybucket"
342+
},
343+
{
344+
type = "registry",
345+
ref = "user/repo:cache"
346+
}
343347
]
344348
}
345349
```
@@ -355,8 +359,14 @@ This takes a list value, so you can specify multiple cache export targets.
355359
```hcl
356360
target "app" {
357361
cache-to = [
358-
"type=s3,region=eu-west-1,bucket=mybucket",
359-
"type=inline"
362+
{
363+
type = "s3",
364+
region = "eu-west-1",
365+
bucket = "mybucket"
366+
},
367+
{
368+
type = "inline",
369+
}
360370
]
361371
}
362372
```
@@ -863,7 +873,7 @@ The following example configures the target to use a cache-only output,
863873

864874
```hcl
865875
target "default" {
866-
output = ["type=cacheonly"]
876+
output = [{ type = "cacheonly" }]
867877
}
868878
```
869879

@@ -903,8 +913,8 @@ variable "HOME" {
903913
904914
target "default" {
905915
secret = [
906-
"type=env,id=KUBECONFIG",
907-
"type=file,id=aws,src=${HOME}/.aws/credentials"
916+
{ type = "env", id = "KUBECONFIG" },
917+
{ type = "file", id = "aws", src = "${HOME}/.aws/credentials" },
908918
]
909919
}
910920
```
@@ -948,7 +958,7 @@ This can be useful if you need to access private repositories during a build.
948958

949959
```hcl
950960
target "default" {
951-
ssh = ["default"]
961+
ssh = [{ id = "default" }]
952962
}
953963
```
954964

0 commit comments

Comments
 (0)