diff options
author | softprops <d.tangren@gmail.com> | 2016-01-18 13:19:09 -0500 |
---|---|---|
committer | softprops <d.tangren@gmail.com> | 2016-01-18 13:19:09 -0500 |
commit | f681bbe8883556ed3d7ff041d9230295c747cb7b (patch) | |
tree | 1c97d094a736019faba46cffb42edae7fbc3e441 /examples | |
parent | 2139459d574a2704cb0756679c6e41b5232bd247 (diff) |
cleanup
Diffstat (limited to 'examples')
-rw-r--r-- | examples/imagedelete.rs | 17 | ||||
-rw-r--r-- | examples/imagepull.rs (renamed from examples/imagecreate.rs) | 4 |
2 files changed, 19 insertions, 2 deletions
diff --git a/examples/imagedelete.rs b/examples/imagedelete.rs new file mode 100644 index 0000000..56c35e4 --- /dev/null +++ b/examples/imagedelete.rs @@ -0,0 +1,17 @@ +extern crate shiplift; + +use shiplift::Docker; +use std::env; + +fn main() { + let docker = Docker::new(); + if let Some(img) = env::args().nth(1) { + let image = docker.images() + .get(&img[..]) + .delete() + .unwrap(); + for status in image { + println!("{:?}", status); + } + } +} diff --git a/examples/imagecreate.rs b/examples/imagepull.rs index 2b1b895..2097f82 100644 --- a/examples/imagecreate.rs +++ b/examples/imagepull.rs @@ -1,13 +1,13 @@ extern crate shiplift; -use shiplift::Docker; +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() - .create(&img[..]) + .pull(&PullOptions::builder().image(img).build()) .unwrap(); for output in image { println!("{:?}", output); |