summaryrefslogtreecommitdiffstats
path: root/examples/imagebuild.rs
blob: 6dbea78e4bba4c21f1bf82b7af00fa681bdcffc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use shiplift::{BuildOptions, Docker};
use std::env;
use tokio::prelude::{Future, Stream};

fn main() {
    let docker = Docker::new();
    let path = env::args().nth(1).expect("You need to specify a path");

    let fut = docker
        .images()
        .build(&BuildOptions::builder(path).tag("shiplift_test").build())
        .for_each(|output| {
            println!("{:?}", output);
            Ok(())
        })
        .map_err(|e| eprintln!("Error: {}", e));

    tokio::run(fut);
}