You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update documents to include information about using a configuration file. Also update the formating on the usage section to allow the discriptions to wrap. Before wrap it was necessary to scroll left and right to read them.
config files with template directives. Config files will be merged if this option is specified multiple times. (default [])
88
+
-endpoint string
89
+
docker api endpoint (tcp|unix://..). Default unix:///var/run/docker.sock
If no `<dest>` file is specified, the output is sent to stdout. Mainly useful for debugging.
125
126
127
+
### Configuration file
128
+
129
+
Using the -config flag from above you can tell docker-gen to 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.
130
+
131
+
An example configuration file, **docker-gen.cfg** can be found in the examples folder.
132
+
133
+
#### Configuration File Syntax
134
+
135
+
***[[config]]***
136
+
Starts a configuration section
137
+
138
+
**dest = "path/to/a/file"**
139
+
path to a write the template. If not specfied, STDOUT is used
140
+
**notifycmd = "/etc/init.d/foo reload"**
141
+
run command after template is regenerated (e.g restart xyz)
142
+
**onlyexposed = true**
143
+
only include containers with exposed ports
144
+
**template = "/path/to/a/template/file.tmpl"**
145
+
path to a template to generate
146
+
**watch = true**
147
+
watch for container changes
148
+
149
+
150
+
***[config.NotifyContainers]***
151
+
Starts a notify container section
152
+
153
+
**containername = 1**
154
+
container name followed by the signal to send
155
+
**container_id = 1**
156
+
or the container id can be used followed by the signal to send
157
+
158
+
Putting it all together here is an example configuration file.
159
+
```
160
+
[[config]]
161
+
template = "/etc/nginx/nginx.conf.tmpl"
162
+
dest = "/etc/nginx/sites-available/default"
163
+
onlyexposed = true
164
+
notifycmd = "/etc/init.d/nginx reload"
165
+
166
+
[[config]]
167
+
template = "/etc/logrotate.conf.tmpl"
168
+
dest = "/etc/logrotate.d/docker"
169
+
watch = true
170
+
171
+
[[config]]
172
+
template = "/etc/docker-gen/templates/nginx.tmpl"
173
+
dest = "/etc/nginx/conf.d/default.conf"
174
+
watch = true
175
+
176
+
[config.NotifyContainers]
177
+
nginx = 1 # 1 is a signal number to be sent; here SIGINT
178
+
e75a60548dc9 = 1 # a key can be either container name (nginx) or ID
0 commit comments