summaryrefslogtreecommitdiffstats
path: root/examples/imagedelete.rs
blob: efa763c215a2220d81edc83d19667acf369efb3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use shiplift::Docker;
use std::env;
use tokio::prelude::Future;

fn main() {
    let docker = Docker::new();
    let img = env::args()
        .nth(1)
        .expect("You need to specify an image name");
    let fut = docker
        .images()
        .get(&img[..])
        .delete()
        .map(|statuses| {
            for status in statuses {
                println!("{:?}", status);
            }
        })
        .map_err(|e| eprintln!("Error: {}", e));
    tokio::run(fut);
}