Low level Rust library for working with OCI (opencontainers) directories
Go to file
Colin Walters 21b2e82baf
Merge pull request #41 from containers/release
Bump oci-spec and our semver
2025-06-17 09:29:42 -04:00
.github/workflows Bump lints toolchain version / fix clippy warnings 2025-06-17 08:42:42 -04:00
examples examples: Add example that injects arbitrary tar as OCI 2025-05-05 12:10:21 -04:00
src Bump lints toolchain version / fix clippy warnings 2025-06-17 08:42:42 -04:00
.gitignore Initial import from https://github.com/ostreedev/ostree-rs-ext/blob/main/lib/src/container/ocidir.rs 2024-06-01 18:09:35 -04:00
Cargo.toml Bump oci-spec and our semver 2025-06-17 09:18:55 -04:00
LICENSE-APACHE Initial import from https://github.com/ostreedev/ostree-rs-ext/blob/main/lib/src/container/ocidir.rs 2024-06-01 18:09:35 -04:00
LICENSE-MIT Initial import from https://github.com/ostreedev/ostree-rs-ext/blob/main/lib/src/container/ocidir.rs 2024-06-01 18:09:35 -04:00
README.md Modify read_index to return an ImageIndex instead of an Option<ImageIndex> 2024-10-12 02:46:56 +03:00
renovate.json Add renovate.json 2024-06-02 14:52:56 +00:00

README.md

ocidir

Crates.io

docs.rs

Read and write to OCI image layout directories

This library contains medium and low-level APIs for working with OCI images, which are basically a directory with blobs and JSON files for metadata.

Dependency on cap-std

This library makes use of cap-std to operate in a capability-oriented fashion. In practice, the code in this project is well tested and would not traverse outside its own path root. However, using capabilities is a generally good idea when operating in the container ecosystem, in particular when actively processing tar streams.

Examples

To access an existing OCI directory:

# use ocidir::cap_std;
# use anyhow::{anyhow, Result};
# fn main() -> anyhow::Result<()> {
let d = cap_std::fs::Dir::open_ambient_dir("/path/to/ocidir", cap_std::ambient_authority())?;
let d = ocidir::OciDir::open(d)?;
println!("{:?}", d.read_index()?);
# Ok(())
# }