Expand description
OCI image conversion library.
Converts OCI container images into squashfs filesystem images, plain tar archives, or extracted directories by merging the image’s layer tarballs directly, without extracting them to intermediate disk storage.
§Concepts
An OCI image is a stack of compressed tar archives (layers). Converting an image means applying them oldest-first, with newer layers overwriting older ones and whiteout files representing deletions. This library implements that merge as a streaming algorithm: entries flow from the compressed layer blobs through the overlay logic directly into the chosen output sink.
The output format and destination are described by ImageSpec, which is
also used as the input source for verify::verify. The same type is used
in both directions to avoid a parallel set of read vs. write descriptors.
§Conversion
For simple one-shot conversions, use convert or one of its named
convenience wrappers (convert_mksquashfs, convert_tar,
convert_dir).
When layers are being downloaded concurrently, use StreamingPacker or
one of the _streaming convenience wrappers. These accept layers in any
arrival order; the merge engine resequences them internally and processes
each layer as soon as its turn arrives, keeping the output sink busy while
remaining layers are still in flight.
§Verification
See verify::verify for comparing a generated image against a reference
directory.
Modules§
- canonical
- PAX-aware tar header type used throughout the merge pipeline.
- dir
- Directory output sink for the OCI layer merge pipeline.
- image
- OCI image layout parsing: reads
index.jsonormanifest.jsonand resolves layer descriptors to blob file paths on disk. - layers
- Layer blob decompression.
- overlay
- Core OCI layer merge algorithm.
- squashfs
- squashfs output sink for the OCI layer merge pipeline.
- tar
- Tar file output sink for the OCI layer merge pipeline.
- tracker
- State tracking data structures for the OCI layer merge algorithm.
- verify
- Verification: diff a generated image against a reference directory.
Structs§
- Layer
Meta - Manifest-derived metadata for a single layer, captured before downloading begins.
- Streaming
Packer - A streaming image packer that accepts layers in any order as downloads complete.
Enums§
- Image
Spec - Format, location, and format-specific configuration of an image.
- Packer
Progress - Progress events emitted by the merge engine as layers are processed.
Functions§
- convert
- Convert an OCI image directory into the format and location described by
spec. - convert_
dir - Extract an OCI image directory directly into
output_dir. - convert_
dir_ streaming - Streaming variant of
convert_dir. - convert_
mksquashfs - Convert an OCI image directory into a squashfs file.
- convert_
mksquashfs_ streaming - Streaming variant of
convert_mksquashfs. - convert_
tar - Convert an OCI image directory into a plain tar file.
- convert_
tar_ streaming - Streaming variant of
convert_tar.