@@ -285,27 +285,19 @@ The key takes a list of annotations, in the format of `KEY=VALUE`.
285
285
286
286
``` hcl
287
287
target "default" {
288
- output = [" type= image, name= foo"]
288
+ output = [{ type = " image", name = " foo" } ]
289
289
annotations = ["org.opencontainers.image.authors=dvdksn"]
290
290
}
291
291
```
292
292
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
-
301
293
By default, the annotation is added to image manifests. You can configure the
302
294
level of the annotations by adding a prefix to the annotation, containing a
303
295
comma-separated list of all the levels that you want to annotate. The following
304
296
example adds annotations to both the image index and manifests.
305
297
306
298
``` hcl
307
299
target "default" {
308
- output = [" type= image, name= foo"]
300
+ output = [{ type = " image", name = " foo" } ]
309
301
annotations = ["index,manifest:org.opencontainers.image.authors=dvdksn"]
310
302
}
311
303
```
@@ -321,8 +313,13 @@ This attribute accepts the long-form CSV version of attestation parameters.
321
313
``` hcl
322
314
target "default" {
323
315
attest = [
324
- "type=provenance,mode=min",
325
- "type=sbom"
316
+ {
317
+ type = "provenance",
318
+ mode = "max",
319
+ },
320
+ {
321
+ type = "sbom",
322
+ }
326
323
]
327
324
}
328
325
```
@@ -338,8 +335,15 @@ This takes a list value, so you can specify multiple cache sources.
338
335
``` hcl
339
336
target "app" {
340
337
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
+ }
343
347
]
344
348
}
345
349
```
@@ -355,8 +359,14 @@ This takes a list value, so you can specify multiple cache export targets.
355
359
``` hcl
356
360
target "app" {
357
361
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
+ }
360
370
]
361
371
}
362
372
```
@@ -863,7 +873,7 @@ The following example configures the target to use a cache-only output,
863
873
864
874
``` hcl
865
875
target "default" {
866
- output = [" type= cacheonly"]
876
+ output = [{ type = " cacheonly" } ]
867
877
}
868
878
```
869
879
@@ -903,8 +913,8 @@ variable "HOME" {
903
913
904
914
target "default" {
905
915
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" },
908
918
]
909
919
}
910
920
```
@@ -948,7 +958,7 @@ This can be useful if you need to access private repositories during a build.
948
958
949
959
``` hcl
950
960
target "default" {
951
- ssh = ["default"]
961
+ ssh = [{ id = "default" } ]
952
962
}
953
963
```
954
964
0 commit comments