diff options
author | softprops <d.tangren@gmail.com> | 2016-01-03 19:43:00 -0500 |
---|---|---|
committer | softprops <d.tangren@gmail.com> | 2016-01-03 19:43:00 -0500 |
commit | 536b1c4312ad9e2e03ca403b260d61d709d20491 (patch) | |
tree | d9517f85486e7bda03d1bf7e602b35cc13e207a6 /examples | |
parent | 58b0f0a1831622ba5d69a1ab2ce562580a0c80ab (diff) |
more examples
Diffstat (limited to 'examples')
-rw-r--r-- | examples/containerinspect.rs | 15 | ||||
-rw-r--r-- | examples/imageinspect.rs | 15 |
2 files changed, 30 insertions, 0 deletions
diff --git a/examples/containerinspect.rs b/examples/containerinspect.rs new file mode 100644 index 0000000..30f462a --- /dev/null +++ b/examples/containerinspect.rs @@ -0,0 +1,15 @@ +extern crate shiplift; + +use shiplift::Docker; +use std::env; + +fn main() { + let docker = Docker::new(); + if let Some(id) = env::args().nth(1) { + let container = docker.containers() + .get(&id) + .inspect() + .unwrap(); + println!("{:?}", container); + } +} diff --git a/examples/imageinspect.rs b/examples/imageinspect.rs new file mode 100644 index 0000000..388f08e --- /dev/null +++ b/examples/imageinspect.rs @@ -0,0 +1,15 @@ +extern crate shiplift; + +use shiplift::Docker; +use std::env; + +fn main() { + let docker = Docker::new(); + if let Some(id) = env::args().nth(1) { + let image = docker.images() + .get(&id) + .inspect() + .unwrap(); + println!("{:?}", image); + } +} |