# tern-tools/tern

Tern is a software composition analysis tool and Python library that generates a Software Bill of Materials for container images and Dockerfiles. The SBOM that Tern generates will give you a layer-by-layer view of what's inside your container in a variety of formats including human-readable, JSON, HTML, SPDX and more.

Repository: https://github.com/tern-tools/tern
Canonical: https://ross.abutalabs.com/products/tern-tools-tern
Language: Python
License: BSD-2-Clause
License Family: permissive
Topics: python, containers, oss-compliance, sbom, docker, compliance, spdx, tool, dependencies, software-composition-analysis, risk-management, open-source, supply-chain-security, metadata-extraction
Last push: 2024-03-12T22:41:47+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3201, "days_push": 904, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1018, forks 190 (observed 2026-08-28T04:03:14.961121+00:00)

## What it is
Tern is a Python-based software composition analysis tool and library that generates a Software Bill of Materials (SBOM) for container images and Dockerfiles. It inspects each image layer to identify installed packages and their metadata, producing reports in human-readable, JSON, HTML, YAML, SPDX, and CycloneDX formats.

## Use cases
- generate an SBOM for a docker image
- create a software bill of materials from a Dockerfile
- list packages installed in each container image layer
- export container dependencies in SPDX or CycloneDX format
- audit open source license compliance in container images
- scan container images for supply chain security

## When to choose
- you need layer-by-layer package metadata for Docker images or Dockerfiles
- you need SBOM output in SPDX, CycloneDX, JSON, HTML, or YAML formats
- you want a Python library or CLI for container software composition analysis

## When to avoid
- you need SBOMs for non-container artifacts like binaries or OS packages outside images
- you need active vulnerability scanning as the primary feature (extensions like cve-bin-tool are optional)
- you need a tool with frequent recent releases or broad runtime support beyond Linux/Docker

## Facets
- artifact type: cli-tool
- maturity: maintenance
- function: security, developer-tools, container-runtime, parser
- domain: security, developer-tools
- platform: python, cli
- tags: sbom, spdx, cyclonedx, software-composition-analysis, supply-chain-security, dockerfile, compliance, oss-compliance, containers, devops, linux, docker

## Member repositories
- tern-tools/tern (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:14.961121+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:09:30.345531+00:00, confidence not recorded.
  - readme: https://github.com/tern-tools/tern (fetched 2026-08-28T04:03:14.961121+00:00, sha 616cd94a7f73)
  - registry_pypi: https://pypi.org/pypi/tern/json (fetched 2026-08-29T13:09:55.733840+00:00, sha 1e484586dba8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
