Skip to content

Commit 16a57c9

Browse files
committed
add template example for dnsmasq hosts list
Can be useful here: https://blog.amartynov.ru/archives/dnsmasq-docker-service-discovery/ Or with this image: https://github.com/andyshinn/docker-dnsmasq
1 parent 7bc7ca9 commit 16a57c9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

templates/dnsmasq.hosts.conf.tmpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{$domain := "docker.company.com"}}
2+
{{range $key, $value := .}}
3+
# {{ $value.Name }} ({{$value.ID}} from {{$value.Image.Repository}})
4+
{{$value.IP}} {{ $value.Name }}.{{$domain}}
5+
{{$value.IP6Global}} {{ $value.Name }}.{{$domain}}
6+
7+
{{end}}

0 commit comments

Comments
 (0)