rust-extensions/crates/runc
dependabot[bot] 2cf2fd4a92
build(deps): update oci-spec requirement from 0.5.8 to 0.6.0
Updates the requirements on [oci-spec](https://github.com/containers/oci-spec-rs) to permit the latest version.
- [Release notes](https://github.com/containers/oci-spec-rs/releases)
- [Changelog](https://github.com/containers/oci-spec-rs/blob/main/release.md)
- [Commits](https://github.com/containers/oci-spec-rs/compare/v0.5.8...v0.6.0)

---
updated-dependencies:
- dependency-name: oci-spec
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 01:44:43 +00:00
..
src Run fmt 2022-09-29 11:55:31 -07:00
Cargo.toml build(deps): update oci-spec requirement from 0.5.8 to 0.6.0 2023-03-13 01:44:43 +00:00
README.md Update README 2022-02-11 10:10:42 -08:00

README.md

Rust bindings for runc CLI

Crates.io docs.rs Crates.io CI

A crate for consuming the runc binary in your Rust applications, similar to go-runc for Go. This crate is based on archived rust-runc.

Usage

Both sync/async version is available. You can build runc client with RuncConfig in method chaining style. Call build() or build_async() to get client. Note that async client depends on tokio, then please use it on tokio runtime.

use runc;

#[tokio::main]
async fn main() {
    let config = runc::Config::new()
        .root("./new_root")
        .debug(false)
        .log("/path/to/logfile.json")
        .log_format(runc::LogFormat::Json)
        .rootless(true);

    let client = config.build_async().unwrap();

    let opts = runc::options::CreateOpts::new()
        .pid_file("/path/to/pid/file")
        .no_pivot(true);
    
    client.create("container-id", "path/to/bundle", Some(&opts)).unwrap();
}

Limitations

  • Supported commands are only:
    • create
    • start
    • state
    • kill
    • delete
  • Exec is not available in RuncAsyncClient now.
  • Console utilites are not available