Crates.io | containerd-shim-wasm |
lib.rs | containerd-shim-wasm |
version | 0.7.0 |
source | src |
created_at | 2023-03-06 21:31:37.004867 |
updated_at | 2024-10-07 22:19:46.642605 |
description | Library for building containerd shims for wasm |
homepage | https://github.com/containerd/runwasi |
repository | https://github.com/containerd/runwasi |
max_upload_size | |
id | 803015 |
size | 201,611 |
A library to help build containerd shims for wasm workloads.
use containerd_shim as shim;
use containerd_shim_wasm::sandbox::{ShimCli, Instance, Nop}
shim::run::<ShimCli<Nop>>("io.containerd.nop.v1", opts);
The above example uses the built-in Nop
instance which does nothing.
You can build your own instance by implementing the Instance
trait.
use containerd_shim as shim;
use containerd_shim_wasm::sandbox::{ShimCli, Instance}
struct MyInstance {
// ...
}
impl Instance for MyInstance {
// ...
}
shim::run::<ShimCli<MyInstance>>("io.containerd.myshim.v1", opts);
containerd expects the shim binary to be installed into $PATH
(as seen by the containerd process) with a binary name like containerd-shim-myshim-v1
which maps to the io.containerd.myshim.v1
runtime which would need to be configured in containerd. It (containerd) also supports specifying a path to the shim binary but needs to be configured to do so.
This crate is not tied to any specific wasm engine.