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

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

    let options = BuildOptions::builder(path).tag("shiplift_test").build();

    let mut stream = docker.images().build(&options);
    while let Some(build_result) = stream.next().await {
        match build_result {
            Ok(output) => println!("{:?}", output),
            Err(e) => eprintln!("Error: {}", e),
        }
    }
}