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

#[tokio::main]
async 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");

    if let Err(e) = volumes.get(&volume_name).delete().await {
        eprintln!("Error: {}", e)
    }
}