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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//! # arcbox-oci
//!
//! OCI runtime specification support for `ArcBox`.
//!
//! This crate provides parsing and management of OCI (Open Container Initiative)
//! runtime specification structures:
//!
//! - **Configuration**: Parse and validate `config.json` according to OCI runtime-spec
//! - **Bundles**: Load and create OCI bundles (directory containing config + rootfs)
//! - **State**: Container lifecycle state management
//! - **Hooks**: Lifecycle hook definitions and validation
//!
//! ## Example
//!
//! ```no_run
//! use arcbox_oci::{Bundle, BundleBuilder, Spec};
//!
//! // Load an existing bundle
//! let bundle = Bundle::load("/path/to/bundle")?;
//! println!("OCI version: {}", bundle.spec().oci_version);
//!
//! // Create a new bundle with builder
//! let bundle = BundleBuilder::new()
//! .hostname("my-container")
//! .args(vec!["nginx".to_string(), "-g".to_string(), "daemon off;".to_string()])
//! .add_env("NGINX_HOST", "localhost")
//! .cwd("/")
//! .build("/path/to/new-bundle")?;
//!
//! // Parse config directly
//! let spec = Spec::load("/path/to/config.json")?;
//! # Ok::<(), arcbox_oci::OciError>(())
//! ```
//!
//! ## OCI Runtime Specification
//!
//! This crate implements the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec)
//! which defines:
//!
//! - Container configuration format (`config.json`)
//! - Container lifecycle states (creating, created, running, stopped)
//! - Lifecycle hooks (prestart, poststart, poststop, etc.)
//! - Platform-specific settings (Linux namespaces, cgroups, etc.)
//!
//! ## Architecture
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────┐
//! │ arcbox-oci │
//! │ │
//! │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
//! │ │ config │ │ bundle │ │ state │ │
//! │ │ │ │ │ │ │ │
//! │ │ - Spec │ │ - Bundle │ │ - State │ │
//! │ │ - Process │ │ - Builder │ │ - Status │ │
//! │ │ - Root │ │ - utils │ │ - Store │ │
//! │ │ - Mounts │ │ │ │ │ │
//! │ │ - Linux │ │ │ │ │ │
//! │ └─────────────┘ └─────────────┘ └─────────────┘ │
//! │ │
//! │ ┌─────────────┐ ┌─────────────┐ │
//! │ │ hooks │ │ error │ │
//! │ │ │ │ │ │
//! │ │ - Hooks │ │ - OciError │ │
//! │ │ - Hook │ │ - Result │ │
//! │ │ - HookType │ │ │ │
//! │ └─────────────┘ └─────────────┘ │
//! └─────────────────────────────────────────────────────────┘
//! ```
// Re-export main types for convenience.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;