An Extremely Simple Async Docker Wrapper in Rust
Contrary to other libraries, KISS Docker does not depend on the docker socket
, but uses use async_process::Command
to
build and execute the right commands.
[dependencies]
kiss_docker = "0.0.2"
extern crate kiss_docker;
use kiss_docker::container::Container;
#[tokio::main]
async fn main() {
match kiss_docker::container::list_all(Some("alpine")).await {
Ok(containers) => containers
.iter()
.for_each(|container| println!("{}", container.id)),
Err(e) => {
panic!("{}", e);
}
};
}
See the the examples directory for more examples.
Running the tests by default requires a few docker images locally
docker pull alpine
Afterwards it's the usual:
cargo test