@@ -119,6 +119,7 @@ type bakeTarget struct {
119
119
Entitlements []string `json:"entitlements,omitempty"`
120
120
ExtraHosts map [string ]string `json:"extra-hosts,omitempty"`
121
121
Outputs []string `json:"output,omitempty"`
122
+ Attest []string `json:"attest,omitempty"`
122
123
}
123
124
124
125
type bakeMetadata map [string ]buildStatus
@@ -255,6 +256,7 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project
255
256
256
257
Outputs : outputs ,
257
258
Call : call ,
259
+ Attest : toBakeAttest (build ),
258
260
}
259
261
}
260
262
@@ -308,6 +310,12 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project
308
310
args = append (args , "--allow" , "security.insecure" )
309
311
}
310
312
}
313
+ if options .SBOM != "" {
314
+ args = append (args , "--sbom=" + options .SBOM )
315
+ }
316
+ if options .Provenance != "" {
317
+ args = append (args , "--provenance=" + options .Provenance )
318
+ }
311
319
312
320
if options .Builder != "" {
313
321
args = append (args , "--builder" , options .Builder )
@@ -458,6 +466,30 @@ func toBakeSecrets(project *types.Project, secrets []types.ServiceSecretConfig)
458
466
return s
459
467
}
460
468
469
+ func toBakeAttest (build types.BuildConfig ) []string {
470
+ var attests []string
471
+
472
+ // Handle per-service provenance configuration (only from build config, not global options)
473
+ if build .Provenance != "" {
474
+ if build .Provenance == "true" {
475
+ attests = append (attests , "type=provenance" )
476
+ } else if build .Provenance != "false" {
477
+ attests = append (attests , fmt .Sprintf ("type=provenance,%s" , build .Provenance ))
478
+ }
479
+ }
480
+
481
+ // Handle per-service SBOM configuration (only from build config, not global options)
482
+ if build .SBOM != "" {
483
+ if build .SBOM == "true" {
484
+ attests = append (attests , "type=sbom" )
485
+ } else if build .SBOM != "false" {
486
+ attests = append (attests , fmt .Sprintf ("type=sbom,%s" , build .SBOM ))
487
+ }
488
+ }
489
+
490
+ return attests
491
+ }
492
+
461
493
func dockerFilePath (ctxName string , dockerfile string ) string {
462
494
if dockerfile == "" {
463
495
return ""
0 commit comments