Skip to content

Commit 066d576

Browse files
authored
Merge pull request #598 from josegonzalez/patch-1
Expand documentation surrounding nested template support
2 parents caca945 + 445e465 commit 066d576

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,15 @@ e75a60548dc9 = 1 # a key can be either container name (nginx) or ID
211211

212212
The templates used by docker-gen are written using the Go [text/template](http://golang.org/pkg/text/template/) language. In addition to the [built-in functions](http://golang.org/pkg/text/template/#hdr-Functions) supplied by Go, docker-gen uses [sprig](https://masterminds.github.io/sprig/) and some additional functions to make it simpler (or possible) to generate your desired output. Some templates rely on environment variables within the container to make decisions on what to generate from the template.
213213

214-
For parsing several templates, split path with `;` (for example `template = "nginx.tmpl;header.tmpl"`). This makes possible to use go nested templates through standard `template` function.
214+
Several templates may be parsed at once by using a semicolon (`;`) to delimit the `template` value. This can be used as a proxy for Golang's nested template functionality. In all cases, the main rendered template should go first.
215+
216+
```
217+
[[config]]
218+
template = "/etc/docker-gen/templates/nginx.tmpl;/etc/docker-gen/templates/header.tmpl"
219+
dest = "/etc/nginx/conf.d/default.conf"
220+
watch = true
221+
wait = "500ms:2s"
222+
```
215223

216224
#### Emit Structure
217225

0 commit comments

Comments
 (0)