1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! # 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
//!
//! - [`ImageRef`] - Reference to an OCI image (registry/repo:tag)
//! - [`unpack_layer`] - Unpacks a tar+gzip OCI layer into the CAS
//! - [`UnpackedEntry`] - A single file extracted from a layer
//! - [`translate_dockerfile`] - Converts a Dockerfile into an `hd.toml` spec
//!
//! ## Example
//!
//! ```no_run
//! 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);
//! ```
pub use ;
pub use ;
pub use ;