OCI artifact packaging for LEI cache snapshots.
Builds OCI Image Manifest v2 artifacts containing LEI analysis cache data with custom media types for Zarf air-gap deployment.
OCI Artifact Structure
ghcr.io/defenseunicorns/lei-cache:2026-02-05
├── manifest.json (application/vnd.lei.cache.manifest+json)
└── cache.jsonl.gz (application/vnd.lei.cache.jsonl+gzip)The OCI manifest wraps these as layers with proper digests and sizes.
Summary
Functions
Creates a blob descriptor from raw content bytes.
Builds an OCI image manifest for the given cache layers.
Returns the cache JSONL layer media type.
Returns the cache manifest layer media type.
Returns the config media type.
Returns the OCI manifest media type.
Maps an OCI layer media type to its expected filename.
Packages cache files into OCI artifact layers.
Unpacks OCI artifact blobs into a target directory.
Functions
Creates a blob descriptor from raw content bytes.
Returns a map with :media_type, :digest, :size, and the raw :data.
Builds an OCI image manifest for the given cache layers.
Accepts a list of layer descriptors (each with :media_type, :digest, :size,
and optional :annotations) and a config descriptor.
Returns the manifest as a map ready for JSON encoding.
Returns the cache JSONL layer media type.
Returns the cache manifest layer media type.
Returns the config media type.
Returns the OCI manifest media type.
Maps an OCI layer media type to its expected filename.
Packages cache files into OCI artifact layers.
Takes a directory containing exported cache files and returns
{:ok, manifest_json, blobs} where blobs is a list of {digest, data} tuples.
@spec unpack( map(), String.t(), (String.t() -> {:ok, binary()} | {:error, String.t()}) ) :: :ok | {:error, String.t()}
Unpacks OCI artifact blobs into a target directory.
Given a parsed OCI manifest and a function to fetch blobs by digest,
writes the cache files to target_dir.