Crates.io | mcai-docker |
lib.rs | mcai-docker |
version | 0.2.2 |
source | src |
created_at | 2022-06-10 13:57:40.424789 |
updated_at | 2024-05-07 19:11:29.955941 |
description | Library to start and stop MCAI workers images with Docker. |
homepage | |
repository | |
max_upload_size | |
id | 603578 |
size | 14,796 |
This crate is a wrapper on bollard crate to enable starting a MCAI worker with Docker.
use bollard::Docker;
use mcai_docker::McaiDocker;
use std::io::stdout;
#[tokio::main]
async fn main() {
let docker = Docker::connect_with_socket_defaults().unwrap();
let mcai_docker = McaiDocker::new(docker);
mcai_docker
.run_worker(
"mcai_worker_image_name",
&[("KEY1", Box::new("VALUE1"))],
Some(&mut stdout()),
)
.await
.unwrap();
}