arcbox-oci
OCI runtime specification support for ArcBox.
Overview
This crate provides parsing and management of OCI (Open Container Initiative) runtime specification structures:
- Configuration: Parse and validate
config.jsonaccording 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
Implements the OCI Runtime Specification v1.2.0.
Features
- Full OCI runtime-spec v1.2.0 compliance
- Bundle management with builder pattern
- Container state persistence
- Lifecycle hooks (prestart, poststart, poststop, etc.)
- Linux-specific configuration (namespaces, cgroups, devices, seccomp)
Usage
use ;
// Load an existing bundle
let bundle = load?;
println!;
// Create a new bundle with builder
let bundle = new
.hostname
.args
.add_env
.cwd
.build?;
// Parse config directly
let spec = load?;
spec.validate?;
Container State Management
use ;
let store = new?;
// Save container state
store.save?;
// Load container state
let state = store.load?;
assert_eq!;
License
MIT OR Apache-2.0