From 50966067658108d08ad79deefb59d471f9c96fa1 Mon Sep 17 00:00:00 2001 From: softprops Date: Sun, 3 Jan 2016 22:24:00 -0500 Subject: container create should following the same pattern as other methods that take options --- examples/containercreate.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 examples/containercreate.rs (limited to 'examples') 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); + } +} -- cgit v1.2.3