build attributes (#23149)

<!--Delete sections as needed -->

## Description

https://github.com/docker/docs/pull/23148/files

## Related issues or tickets

<!-- Related issues, pull requests, or Jira tickets -->

## Reviews

<!-- Notes for reviewers here -->
<!-- List applicable reviews (optionally @tag reviewers) -->

- [ ] Technical review
- [ ] Editorial review
- [ ] Product review
This commit is contained in:
Allie Sadler 2025-07-24 13:27:56 +01:00 committed by GitHub
parent 8e06937458
commit 83d589d2de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 46 additions and 1 deletions

View File

@ -23,7 +23,7 @@ For more detailed information, see the [release notes in the Compose repo](https
- Added `--models` flag to `config` command to list models
- Added `--since` and `--until` flags to `events`
- Introduced `provenance` and `sbom` attributes to `develop` section
- Introduced `provenance` and `sbom` attributes to `build` section
- Fixed `bridge convert` issue on Windows
- Fixed multiple issues with `bake` builds

View File

@ -424,11 +424,52 @@ build:
privileged: true
```
### `provenance`
{{< summary-bar feature_name="Compose provenance" >}}
`provenance` configures the builder to add a [provenance attestation](https://slsa.dev/provenance/v0.2#schema) to the published image.
The value can be either a boolean to enable/disable provenance attestation, or a key=value string to set provenance configuration. You can
use this to select the level of detail to be included in the provenance attestation by setting the `mode` parameter.
```yaml
build:
context: .
provenance: true
```
```yaml
build:
context: .
provenance: mode=max
```
### `pull`
`pull` requires the image builder to pull referenced images (`FROM` Dockerfile directive), even if those are already
available in the local image store.
### `sbom`
{{< summary-bar feature_name="Compose sbom" >}}
`sbom` configures the builder to add a [provenance attestation](https://slsa.dev/provenance/v0.2#schema) to the published image.
The value can be either a boolean to enable/disable sbom attestation, or a key=value string to set SBOM generator configuration. This let you
select an alternative SBOM generator image (see https://github.com/moby/buildkit/blob/master/docs/attestations/sbom-protocol.md)
```yaml
build:
context: .
sbom: true
```
```yaml
build:
context: .
sbom: generator=docker/scout-sbom-indexer:latest # Use an alternative SBOM generator
```
### `secrets`
`secrets` grants access to sensitive data defined by [secrets](services.md#secrets) on a per-service build basis. Two

View File

@ -125,10 +125,14 @@ Compose post start:
requires: Docker Compose [2.30.0](/manuals/compose/releases/release-notes.md#2300) and later
Compose pre stop:
requires: Docker Compose [2.30.0](/manuals/compose/releases/release-notes.md#2300) and later
Compose provenance:
requires: Docker Compose [2.39.0](/manuals/compose/releases/release-notes.md#2390) and later
Compose uts:
requires: Docker Compose [2.15.1](/manuals/compose/releases/release-notes.md#2151) and later
Composefile include:
requires: Docker Compose [2.20.0](/manuals/compose/releases/release-notes.md#2200) and later
Compose sbom:
requires: Docker Compose [2.39.0](/manuals/compose/releases/release-notes.md#2390) and later
containerd:
availability: Experimental
Dev Environments: