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

#[tokio::main]
async fn main() {
    let docker = Docker::new();
    let img = env::args()
        .nth(1)
        .expect("You need to specify an image name");
    match docker.images().get(&img).delete().await {
        Ok(statuses) => {
            for status in statuses {
                println!("{:?}", status);
            }
        }
        Err(e) => eprintln!("Error: {}", e),
    }
}