Skip to content

Commit 4c05b55

Browse files
committed
Update install and usage docs
* Add docs for jwilder/nginx-proxy trusted build * Update release links to 0.1.2. * Add -endpoint and DOCKER_HOST docs * Formatting for command-line samples
1 parent 33d441b commit 4c05b55

File tree

1 file changed

+39
-15
lines changed

1 file changed

+39
-15
lines changed

README.md

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,30 @@ docker-gen can be used to generate various kinds of files for:
1414

1515
### Installation
1616

17-
Linux binaries for release [0.1.1](https://github.com/jwilder/docker-gen/releases)
17+
#### Host Install
1818

19-
* [amd64](https://github.com/jwilder/docker-gen/releases/download/0.1.1/docker-gen-linux-amd64-0.1.1.tar.gz)
20-
* [i386](https://github.com/jwilder/docker-gen/releases/download/0.1.1/docker-gen-linux-i386-0.1.1.tar.gz)
19+
Linux binaries for release [0.1.2](https://github.com/jwilder/docker-gen/releases)
20+
21+
* [amd64](https://github.com/jwilder/docker-gen/releases/download/0.1.2/docker-gen-linux-amd64-0.1.2.tar.gz)
22+
* [i386](https://github.com/jwilder/docker-gen/releases/download/0.1.2/docker-gen-linux-i386-0.1.2.tar.gz)
2123

2224
Download the version you need, untar, and install to your PATH.
2325

2426
```
25-
wget https://github.com/jwilder/docker-gen/releases/download/0.1.1/docker-gen-linux-amd64-0.1.0.tar.gz
26-
tar xvzf tar xvzf docker-gen-linux-amd64-0.1.0.tar.gz
27-
./docker-gen
27+
$ wget https://github.com/jwilder/docker-gen/releases/download/0.1.1/docker-gen-linux-amd64-0.1.0.tar.gz
28+
$ tar xvzf tar xvzf docker-gen-linux-amd64-0.1.0.tar.gz
29+
$ ./docker-gen
2830
```
2931

32+
#### Container Install
33+
34+
See [jwilder/nginx-proxy](https://index.docker.io/u/jwilder/nginx-proxy/) trusted build as an example of running docker-gen within a container.
35+
36+
3037
### Usage
3138
```
32-
docker-gen
33-
Usage: docker-gen [-config file] [-watch=false] [-notify="restart xyz"] [-interval=0] <template> [<dest>]
39+
$ docker-gen
40+
Usage: docker-gen [-config file] [-watch=false] [-notify="restart xyz"] [-interval=0] [-endpoint tcp|unix://..] <template> [<dest>]
3441
```
3542

3643
*Options:*
@@ -40,6 +47,7 @@ or stopped, the template is regenerated.
4047
haproxy, etc..
4148
* `-config file` - Use the specified config file instead of command-line options. Multiple templates can be defined and they will be executed in the order that they appear in the config file.
4249
* `-interval <secs>` - Run the notify command on a fixed interval. Useful for service registration use cases.
50+
* `-endpoint tcp|unix://..` - Use a different docker remote API endpoint. This can also be set w/ a `DOCKER_HOST` environment variable.
4351

4452
If no `<dest>` file is specified, the output is sent to stdout. Mainly useful for debugging.
4553

@@ -48,24 +56,41 @@ If no `<dest>` file is specified, the output is sent to stdout. Mainly useful f
4856

4957
#### NGINX Reverse Proxy Config
5058

59+
##### Containerized
60+
61+
[jwilder/nginx-proxy](https://index.docker.io/u/jwilder/nginx-proxy/) trusted build.
62+
63+
Start nginx-proxy:
64+
65+
```
66+
$ docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock -t jwilder/nginx-proxy
67+
```
68+
69+
Then start containers with a VIRTUAL_HOST env variable:
70+
```
71+
$ docker run -e VIRTUAL_HOST=foo.bar.com -t ...
72+
```
73+
74+
##### Host Install
75+
5176
```
52-
docker-gen -only-exposed -watch -notify "/etc/init.d/nginx reload" templates/nginx.tmpl /etc/nginx/sites-enabled/default
77+
$ docker-gen -only-exposed -watch -notify "/etc/init.d/nginx reload" templates/nginx.tmpl /etc/nginx/sites-enabled/default
5378
```
5479

5580
[Automated Nginx Reverse Proxy for Docker](http://jasonwilder.com/blog/2014/03/25/automated-nginx-reverse-proxy-for-docker/)
5681

5782
#### Fluentd Log Management
5883

5984
```
60-
docker-gen -watch -notify "restart fluentd" templates/fluentd.tmpl /etc/fluent/fluent.conf
85+
$ docker-gen -watch -notify "restart fluentd" templates/fluentd.tmpl /etc/fluent/fluent.conf
6186
```
6287

6388
[Docker Log Management With Fluentd](http://jasonwilder.com/blog/2014/03/17/docker-log-management-using-fluentd/)
6489

6590
#### Register Containers in Etcd
6691

6792
```
68-
docker-gen -notify "/bin/bash /tmp/etcd.sh" -interval 10 templates/etcd.tmpl /tmp/etcd.sh
93+
$ docker-gen -notify "/bin/bash /tmp/etcd.sh" -interval 10 templates/etcd.tmpl /tmp/etcd.sh
6994
```
7095

7196

@@ -74,13 +99,12 @@ docker-gen -notify "/bin/bash /tmp/etcd.sh" -interval 10 templates/etcd.tmpl /tm
7499
This project uses [godep](https://github.com/tools/godep) for managing 3rd party dependencies. You'll need to install godep into your workspace before hacking on docker-gen.
75100

76101
```
77-
git clone <your fork>
78-
godep restore
79-
make
102+
$ git clone <your fork>
103+
$ godep restore
104+
$ make
80105
```
81106

82107
### TODO
83108

84-
* Add Dockerfile and trusted build
85109
* Add event status for handling start and stop events differently
86110
* Add a way to filter out containers in templates

0 commit comments

Comments
 (0)