summaryrefslogtreecommitdiffstats
path: root/examples/volumedelete.rs
blob: 3800d22a9e56162d77c6141e1007a72e882945bc (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;

fn main() {
    let docker = Docker::new();
    let volumes = docker.volumes();

    let volume_name = env::args()
        .nth(1)
        .expect("You need to specify an volume name");

    let fut = volumes
        .get(&volume_name)
        .delete()
        .map(|info| println!("{:?}", info))
        .map_err(|e| eprintln!("Error: {}", e));

    tokio::run(fut);
}