summaryrefslogtreecommitdiffstats
path: root/examples/imagepull.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/imagepull.rs')
-rw-r--r--examples/imagepull.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/imagepull.rs b/examples/imagepull.rs
new file mode 100644
index 0000000..2097f82
--- /dev/null
+++ b/examples/imagepull.rs
@@ -0,0 +1,16 @@
+extern crate shiplift;
+
+use shiplift::{Docker, PullOptions};
+use std::env;
+
+fn main() {
+ let docker = Docker::new();
+ if let Some(img) = env::args().nth(1) {
+ let image = docker.images()
+ .pull(&PullOptions::builder().image(img).build())
+ .unwrap();
+ for output in image {
+ println!("{:?}", output);
+ }
+ }
+}