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
- id: C1 claim: Pass --attest type=sbom, or the shorthand --sbom=true, to create an SBOM attestation. source: S1 evidence: "To create an SBOM attestation, pass the --attest type=sbom"
- id: C2 claim: By default BuildKit only scans the final stage of an image. source: S2 evidence: "By default, BuildKit only scans the final stage of an image."
- id: C3 claim: The generated SBOM follows SPDX and is attached as JSON using an in-toto predicate. source: S1 evidence: "follow the SPDX standard and attach to the final image as a JSON-encoded"
Sources
- [S1] SBOM attestations. Docker, Inc.. https://docs.docker.com/build/metadata/attestations/sbom/ . License: Apache License 2.0. Accessed 2026-11-27.
- [S2] SBOM attestations (source). Docker, Inc.. https://raw.githubusercontent.com/docker/docs/main/content/manuals/build/metadata/attestations/sbom.md . License: Apache License 2.0. Accessed 2026-11-27.
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
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.},
}
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.
- docker-build-sbom.schema.json (schema; CC-BY-4.0)
- docker-build-sbom.table.json (table; CC-BY-4.0)
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.