blob: 5e03f20454ed427c6758bb54344b90822f5cca06 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
use shiplift::Docker;
use std::env;
use tokio::prelude::{Future, Stream};
fn main() {
let docker = Docker::new();
let containers = docker.containers();
let id = env::args()
.nth(1)
.expect("Usage: cargo run --example stats -- <container>");
let fut = containers
.get(&id)
.stats()
.for_each(|stat| {
println!("{:?}", stat);
Ok(())
})
.map_err(|e| eprintln!("Error: {}", e));
tokio::run(fut);
}
|