diff options
author | softprops <d.tangren@gmail.com> | 2016-01-03 22:24:00 -0500 |
---|---|---|
committer | softprops <d.tangren@gmail.com> | 2016-01-03 22:24:00 -0500 |
commit | 50966067658108d08ad79deefb59d471f9c96fa1 (patch) | |
tree | 4edcceee11805749be4a500395508228cfce84e6 /examples | |
parent | 49b5b4fd76cb2641caed877fc95a73368451b3af (diff) |
container create should following the same pattern as other methods that take options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/containercreate.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/containercreate.rs b/examples/containercreate.rs new file mode 100644 index 0000000..8d51055 --- /dev/null +++ b/examples/containercreate.rs @@ -0,0 +1,15 @@ +extern crate shiplift; + +use shiplift::{ContainerOptions, Docker}; +use std::env; + +fn main() { + let docker = Docker::new(); + let containers = docker.containers(); + if let Some(image) = env::args().nth(1) { + let info = containers.create( + &ContainerOptions::builder(image.as_ref()).build() + ).unwrap(); + println!("{:?}", info); + } +} |