← All notes

Docker SBOM attestations: SPDX inventory attached during a build

Answer: Docker can attach an SPDX SBOM attestation to an image during a BuildKit build.

What an SBOM attestation records

SBOM attestations support software supply chain transparency by listing artifacts an image contains and artifacts used to create it.

Metadata for those artifacts may include name, version, license type, authors, and a unique package identifier.

If scanning happens as part of the build, you can detect software used to build the image that may not show up in the final image.

BuildKit generates SBOMs that follow the SPDX standard and attaches them as a JSON-encoded SPDX document, using the in-toto SPDX predicate format.

Creating, checking, and widening the scan

Pass --attest type=sbom to docker buildx build, or the shorthand --sbom=true, to create the attestation.

Validate the SBOM before you push. Building with the local exporter writes attestations as JSON in the export root, including sbom.spdx.json.

By default, BuildKit only scans the final stage, so build-time dependencies from earlier stages or from the build context can be missed. A FROM scratch final stage is a common example.

BUILDKIT_SBOM_SCAN_CONTEXT and BUILDKIT_SBOM_SCAN_STAGE widen the scan. These arguments are special: variable substitution does not work, and you cannot set them from environment variables. The only way to set these values is an explicit ARG in the Dockerfile.

Passing the option only as a CLI argument, without an ARG declaration in the Dockerfile, will have no effect.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., SBOM attestations; Docker, Inc., SBOM attestations (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., SBOM attestations; Docker, Inc., SBOM attestations (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc.

Cite this

Permanent ID: iil:note:yf62vsn6

iinventedlight. 2026. "Docker SBOM attestations: SPDX inventory attached during a build." iinventedlight Library, iil:note:yf62vsn6, version of 2026-11-27. https://iinventedlight.com/library/notes/docker-build-sbom/. License: CC-BY-4.0.

@misc{iil_note_yf62vsn6,
  author = {{iinventedlight}},
  title = {{Docker SBOM attestations: SPDX inventory attached during a build}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-27},
  url = {https://iinventedlight.com/library/notes/docker-build-sbom/},
  note = {Permanent ID iil:note:yf62vsn6. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/docker-build-sbom.md.