@@ -285,27 +285,19 @@ The key takes a list of annotations, in the format of `KEY=VALUE`.
285285
286286``` hcl
287287target "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-
301293By default, the annotation is added to image manifests. You can configure the
302294level of the annotations by adding a prefix to the annotation, containing a
303295comma-separated list of all the levels that you want to annotate. The following
304296example adds annotations to both the image index and manifests.
305297
306298``` hcl
307299target "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
322314target "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
339336target "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
356360target "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
865875target "default" {
866- output = [" type= cacheonly"]
876+ output = [{ type = " cacheonly" } ]
867877}
868878```
869879
@@ -903,8 +913,8 @@ variable "HOME" {
903913
904914target "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
950960target "default" {
951- ssh = ["default"]
961+ ssh = [{ id = "default" } ]
952962}
953963```
954964
0 commit comments