Skip to main content

Crate hd_oci

Crate hd_oci 

Source
Expand description

§hd-oci

OCI image ingestion and Dockerfile translation for hyperdocker.

This crate handles interoperability with the OCI container ecosystem. It can pull OCI images from container registries, unpack their layers into the CAS, and translate Dockerfiles into hd.toml environment specs for a smooth migration path from Docker to hyperdocker.

§Key Types

§Example

use hd_oci::{ImageRef, translate_dockerfile};

// Translate Dockerfile content into an EnvSpec
let content = std::fs::read_to_string("Dockerfile").unwrap();
let spec = translate_dockerfile(&content).unwrap();
println!("{:?}", spec);

// Reference an OCI image
let image = ImageRef::parse("ubuntu:22.04").unwrap();
println!("pulling {}", image);

Re-exports§

pub use registry::ImageRef;
pub use registry::RegistryError;
pub use unpack::unpack_layer;
pub use unpack::UnpackedEntry;
pub use unpack::UnpackError;
pub use dockerfile::translate_dockerfile;
pub use dockerfile::DockerfileError;

Modules§

dockerfile
registry
unpack