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

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);
}