Crates.io | dockers |
lib.rs | dockers |
version | 0.1.6 |
source | src |
created_at | 2019-03-09 16:48:31.219766 |
updated_at | 2019-08-31 14:09:58.513203 |
description | A rust docker library |
homepage | |
repository | https://github.com/donflopez/dockers.git |
max_upload_size | |
id | 119627 |
size | 22,284 |
A rust docker library.
The main difference with other docker libs is that I didn't see the need of making this async (and use futures) for my use case so this is a plain sync method wrapper around the docker api. You can make sync work with this and, if needed, implement async code on top of it, but for that, you probably prefer other options out there.
extern crate dockers;
use dockers::Container;
use dockers::Image;
fn main () {
let img = Image::pull("debian".to_owned(), None)
.expect("Cannot pull image");
let cont = Container::new(None, Some("debian".to_owned()))
.create(Some("my_debian_cont_name".to_owned(), None))
.expect("Cannot create container");
// Do your things...
cont.remove();
img.remove();
}