summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorsoftprops <d.tangren@gmail.com>2016-01-03 22:24:00 -0500
committersoftprops <d.tangren@gmail.com>2016-01-03 22:24:00 -0500
commit50966067658108d08ad79deefb59d471f9c96fa1 (patch)
tree4edcceee11805749be4a500395508228cfce84e6 /examples
parent49b5b4fd76cb2641caed877fc95a73368451b3af (diff)
container create should following the same pattern as other methods that take options
Diffstat (limited to 'examples')
-rw-r--r--examples/containercreate.rs15
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);
+ }
+}