Documentation
¶
Overview ¶
Package ocicache reads OCI images from hypeman's shared OCI blob cache.
The cache is a content-addressable blob store under <data-dir>/system/oci-cache (see lib/paths). Images pushed to the embedded registry or pulled from remote registries are stored there as manifest, config, and layer blobs. This package reconstructs a go-containerregistry v1.Image from those blobs so callers can inspect or re-push cached images without a daemon.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidDigest = errors.New("invalid image digest")
ErrInvalidDigest means a digest is not a well-formed sha256 hex string and cannot be used as a cache path component.
var ErrNotFound = errors.New("image not found in OCI cache")
ErrNotFound means no manifest blob exists in the cache for the requested digest.
Functions ¶
func AppendImage ¶
AppendImage writes img's blobs into the OCI layout at cacheDir, then appends a descriptor tagged with org.opencontainers.image.ref.name=tag to index.json.
Every file is written to a temp file and renamed into place, so readers never see a partial blob or index and an interrupted write never replaces a good file. Blob writes run concurrently; the index update is serialized.
func ImageFromCache ¶
ImageFromCache creates a v1.Image that reads from the OCI blob cache. Docker v2 manifests are transparently converted to OCI format, matching the conversion applied when images are appended to the OCI layout. Returns ErrInvalidDigest for a malformed digest and ErrNotFound when the manifest blob is not in the cache.
Types ¶
This section is empty.