Generate a CycloneDX or SPDX SBOM from a container image using Syft

domain: github.com/anchore/syft · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install Syft via the official script: curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin, or via Homebrew.
  2. Generate a CycloneDX JSON SBOM from a remote image: syft docker.io/org/image:tag -o cyclonedx-json > sbom.cdx.json.
  3. Generate an SPDX JSON SBOM: syft docker.io/org/image:tag -o spdx-json > sbom.spdx.json.
  4. Scan a local filesystem or directory instead of an image: syft dir:./myapp -o cyclonedx-json > app-sbom.cdx.json.
  5. Embed the SBOM generation step in your CI pipeline immediately after the image build step, capturing the digest-tagged image reference to ensure the SBOM corresponds to the exact built image.
  6. Feed the generated SBOM into a vulnerability scanner (e.g., Grype) or sign it as an OCI attestation with cosign attest for supply-chain provenance.

Known gotchas

Related routes

Generate a CycloneDX and SPDX SBOM from a container image using Syft, then diff two SBOMs from successive builds to detect component drift
security/compliance · 5 steps · unrated
Generate an SPDX SBOM for a container image with syft and attach it as a cosign attestation
github.com/anchore/syft · 6 steps · unrated
Generate a Software Bill of Materials for a container image in both CycloneDX JSON and SPDX JSON formats using Syft
github.com/anchore/syft · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans