summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorsoftprops <d.tangren@gmail.com>2016-01-03 19:43:00 -0500
committersoftprops <d.tangren@gmail.com>2016-01-03 19:43:00 -0500
commit536b1c4312ad9e2e03ca403b260d61d709d20491 (patch)
treed9517f85486e7bda03d1bf7e602b35cc13e207a6 /examples
parent58b0f0a1831622ba5d69a1ab2ce562580a0c80ab (diff)
more examples
Diffstat (limited to 'examples')
-rw-r--r--examples/containerinspect.rs15
-rw-r--r--examples/imageinspect.rs15
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);
+ }
+}