summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorsoftprops <d.tangren@gmail.com>2016-01-18 13:26:29 -0500
committersoftprops <d.tangren@gmail.com>2016-01-18 13:26:29 -0500
commitb285fbbe01c5dc117f858ea54bf9c1e805ef11e3 (patch)
treea867902908a9351d1a732e707c3a616da6cd0411 /README.md
parenta6c457dae9755a95333d7a3dc6b3f8e948f4d7ef (diff)
add more readme examples
Diffstat (limited to 'README.md')
-rw-r--r--README.md33
1 files changed, 28 insertions, 5 deletions
diff --git a/README.md b/README.md
index a6c3a03..8edfb99 100644
--- a/README.md
+++ b/README.md
@@ -23,8 +23,8 @@ Some small example programs can be found in this repository's [examples director
### communicating with hosts
-To use shiplift, you must first have a active docker daemon readily accessible. Typically, this daemon processs
-is resolvable via a url defined by an env var named `DOCKER_HOST`. If you are using osx, [docker-machine](https://docs.docker.com/machine/) typically
+To use shiplift, you must first have a docker daemon readily accessible. Typically this daemon processs
+is resolvable via a url specified by an env var named `DOCKER_HOST`. If you are using osx, [docker-machine](https://docs.docker.com/machine/) typically
will have already set up every thing you need to get started when you run `docker-machine env {envid}`.
```rust
@@ -73,9 +73,32 @@ for i in image.search("rust").unwrap() {
}
```
-#### creating new images from existing image
+#### creating new image by pulling an existing image
-todo
+```rust
+use shiplift::PullOptions;
+let output = images.pull(
+ &PullOptions.builder().image("redis:2.8.18").build()
+).unwrap();
+for o in output {
+ println!("{:?}", o);
+}
+```
+
+### build an image from the contents of a directory containing a Dockerfile
+
+the following is equivalent to `docker build -t shiplift_test .`
+
+```rust
+use shiplift::BuildOptions;
+
+let output = images.build(
+ &BuildOptions::builder(".").tag("shiplift_test").build()
+).unwrap();
+for o in output {
+ println!("{:?}", o);
+}
+```
#### accessing image info
@@ -174,4 +197,4 @@ container.restart();
todoc
-Doug Tangren (softprops) 2015
+Doug Tangren (softprops) 2015-2016