summaryrefslogtreecommitdiffstats
path: root/examples/containerdelete.rs
blob: cc2e9b7375f38b2a3d728475809de634fa3a39ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
extern crate shiplift;
extern crate tokio;

use shiplift::Docker;
use std::env;
use tokio::prelude::Future;

fn main() {
    let docker = Docker::new();
    let id = env::args()
        .nth(1)
        .expect("You need to specify an container id");
    let fut = docker
        .containers()
        .get(&id)
        .delete()
        .map_err(|e| eprintln!("Error: {}", e));
    tokio::run(fut);
}