---
title: "How to Generate an SBOM for Container Workflows"
description: "Generating SBOMs at build time, rather than scanning finished images, captures resolved transitive dependencies, statically linked components and multi-stage build contents that heuristic post-build scanners miss."
url: "https://swe.quest/articles/how-to-generate-an-sbom-for-container-workflows-37c04afe004cbbed"
canonical: "https://www.docker.com/blog/sbom-generation-for-container-workflows/"
source: "Docker"
published: "2026-06-25"
difficulty: "medium"
kind: "How-to"
reading_minutes: 10
tags: ["supply-chain-security","containers","ci-cd"]
---

# How to Generate an SBOM for Container Workflows

A post on [Docker](https://swe.quest/sources/docker.md), published 2026-06-25, 10 min read, How-to. Original: [https://www.docker.com/blog/sbom-generation-for-container-workflows/](https://www.docker.com/blog/sbom-generation-for-container-workflows/)

## Summary

Generating SBOMs at build time, rather than scanning finished images, captures resolved transitive dependencies, statically linked components and multi-stage build contents that heuristic post-build scanners miss. An actionable SBOM is complete, records resolved rather than declared versions, is regenerated with every build, is cryptographically bound to the image digest, and validates against the SPDX or CycloneDX schema. In CI, generate from the final stage via BuildKit attestations and attach the SBOM as an OCI attestation. Validate component counts and digest binding before pushing, and pin generator tools to commit SHAs because they run with elevated build access. SPDX is the default for container images, while CycloneDX suits security-focused workflows.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Supply chain security](https://swe.quest/tags/supply-chain-security.md) (Security)
- [Containers](https://swe.quest/tags/containers.md) (Infrastructure)
- [CI/CD](https://swe.quest/tags/ci-cd.md) (Reliability & operations)

## Prerequisites

- Docker multi-stage builds ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))
- CI/CD pipelines ([easy posts on CI/CD](https://swe.quest/tags/ci-cd.md?difficulty=easy))
- container registries

## Keywords

SBOM, SPDX, CycloneDX, BuildKit, in-toto, SLSA, Docker Scout, Docker Hardened Images

## Related posts

- [What is an SBOM (and Why Can’t You Ship Without One)?](https://swe.quest/articles/what-is-an-sbom-and-why-can-t-you-ship-without-one-5b5e9139b8ff0e33.md): Docker · 2026-06-23 · Medium · 12 min read · Supply chain security, Containers, CI/CD
  A software bill of materials is a machine-readable inventory of every resolved component in an artifact, covering name, version, supplier, license, purl identifiers, dependency relationships and checksums, usually expressed in SPDX or CycloneDX.
- [5 Software Supply Chain Security Best Practices for Development Teams](https://swe.quest/articles/5-software-supply-chain-security-best-practices-for-development-teams-fc6a0688d6d5d6a0.md): Docker · 2026-06-08 · Medium · 10 min read · Supply chain security, Containers, CI/CD
  Software supply chain security for container workloads breaks down into five areas: trusted content, build security, pre-deployment verification, access and policy controls, and continuous monitoring.
- [Generating Software Bills of Materials (SBOMs) with SPDX at Microsoft](https://swe.quest/articles/generating-software-bills-of-materials-sboms-with-spdx-at-microsoft-039b53cdd403b886.md): Engineering@Microsoft · 2021-10-13 · Medium · 5 min read · Supply chain security, CI/CD, Build systems
  Microsoft is converting its proprietary build manifests into SPDX 2.2.1 JSON SBOMs, the ISO/IEC 5962:2021 standard, for every product it builds, to comply with the 2021 U.S. cybersecurity executive order.
- [Microsoft open sources its software bill of materials (SBOM) generation tool](https://swe.quest/articles/microsoft-open-sources-its-software-bill-of-materials-sbom-generation-tool-333b2dc59a2c5eb3.md): Engineering@Microsoft · 2022-07-12 · Easy · 2 min read · Supply chain security, Open source, Build systems
  Microsoft has open sourced its build-time SBOM generator, a cross-platform (Windows, Linux, Mac) tool that emits SPDX documents and auto-detects dependencies from npm, NuGet, PyPI, Maven, Go, Rust crates, RubyGems, container Linux packages and more via the Component Detection library.
- [Making the Most of Your Docker Hardened Images Enterprise Trial – Part 2](https://swe.quest/articles/making-the-most-of-your-docker-hardened-images-enterprise-trial-part-2-8510cddca69c59f8.md): Docker · 2026-01-24 · Medium · 9 min read · Supply chain security, Containers, Security
  Docker Hardened Images ship 16 signed in-toto attestations (SLSA provenance, CycloneDX/SPDX SBOMs, FIPS, STIG, Scout scans, OpenVEX), and you can check vendor claims yourself with \`docker scout attestation get\` and \`jq\`.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
