Skip to content

Commit 8286b53

Browse files
committed
README cleanup
1 parent cf03e9e commit 8286b53

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

README.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
docker-gen
22
=====
33

4-
`docker-gen` is a config file generator that uses templates to generate files using docker container meta-data.
4+
`docker-gen` is a file generator that renders templates using docker container meta-data.
55

6-
This is can be used to generate config files for:
6+
docker-gen can be used to generate various kinds of files for:
77

8-
* fluentd, logstash or other centralized logging tools that tail the containers JSON log file.
9-
* logrotate files to rotate container JSON log files
10-
* nginx, haproxy, etc. reverse proxy configs to route requests from the host to containers
8+
* **Centralized logging** - fluentd, logstash or other centralized logging tools that tail the containers JSON log file or files within the container.
9+
* **Log Roatation** - logrotate files to rotate container JSON log files
10+
* **Reverse Proxy Configs** - nginx, haproxy, etc. reverse proxy configs to route requests from the host to containers
11+
* **Service Discovery** - Scripts (python, bash, etc..) to register containers within etcd, hipache, etc..
1112

1213
===
1314

14-
### Usage
15+
### Installation
1516

16-
`go get github.com/jwilder/docker-gen`
17+
```
18+
go get github.com/jwilder/docker-gen
19+
```
1720

21+
### Usage
1822
```
1923
docker-gen
20-
Usage: docker-gen [-config file] [-watch=false] [-notify="restart xyz"] <template> [<dest>]
24+
Usage: docker-gen [-config file] [-watch=false] [-notify="restart xyz"] [-interval=0] <template> [<dest>]
2125
```
2226

2327
*Options:*
@@ -26,24 +30,34 @@ or stopped, the template is regenerated.
2630
* `-notify` - runs a command after the template is generated. Useful for restarting nginx, reloading
2731
haproxy, etc..
2832
* `-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.
33+
* `-interval <secs>` - Run the notify command on a fixed interval. Useful for service registration use cases.
34+
35+
If no `<dest>` file is specified, the output is sent to stdout. Mainly useful for debugging.
36+
2937

30-
If no `<dest>` file is specified, the output is send to stdout. Mainly useful for debugging.
38+
### Examples
3139

3240
#### NGINX Reverse Proxy Config
3341

34-
`docker-gen -only-exposed -watch -notify "/etc/init.d/nginx reload" templates/nginx.tmpl /etc/nginx/sites-enabled/default`
42+
```
43+
docker-gen -only-exposed -watch -notify "/etc/init.d/nginx reload" templates/nginx.tmpl /etc/nginx/sites-enabled/default
44+
```
3545

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

3848
#### Fluentd Log Management
3949

40-
`docker-gen -watch -notify "restart fluentd" templates/fluentd.tmpl /etc/fluent/fluent.conf`
50+
```
51+
docker-gen -watch -notify "restart fluentd" templates/fluentd.tmpl /etc/fluent/fluent.conf
52+
```
4153

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

4456
#### Register Containers in Etcd
4557

46-
`docker-gen -notify "/bin/bash /tmp/etcd.sh" -interval 10 templates/etcd.tmpl /tmp/etcd.sh`
58+
```
59+
docker-gen -notify "/bin/bash /tmp/etcd.sh" -interval 10 templates/etcd.tmpl /tmp/etcd.sh
60+
```
4761

4862

4963
### TODO

0 commit comments

Comments
 (0)