Crates.io | runc |
lib.rs | runc |
version | 0.2.0 |
source | src |
created_at | 2022-02-11 17:49:00.074264 |
updated_at | 2022-03-10 23:55:09.686552 |
description | A crate for consuming the runc binary in your Rust applications |
homepage | https://containerd.io |
repository | https://github.com/containerd/rust-extensions |
max_upload_size | |
id | 530852 |
size | 90,795 |
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.
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();
}
RuncAsyncClient
now.