blob: a9c5b36f44aef9610a7abcc7be36f4499ade88e6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
use shiplift::{Docker, PullOptions};
use std::env;
use tokio::prelude::{Future, Stream};
fn main() {
let docker = Docker::new();
let img = env::args()
.nth(1)
.expect("You need to specify an image name");
let fut = docker
.images()
.pull(&PullOptions::builder().image(img).build())
.for_each(|output| {
println!("{:?}", output);
Ok(())
})
.map_err(|e| eprintln!("Error: {}", e));
tokio::run(fut);
}
|