We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 81c6355 commit 80c4d34Copy full SHA for 80c4d34
examples/docker-compose.yml
@@ -1,5 +1,6 @@
1
redis:
2
image: redis:2.8
3
+ hostname: core
4
ports:
5
- 6379
6
main.go
@@ -33,6 +33,7 @@ fi
33
--restart=always \
34
-d \
35
--name {{.Service.Name}}_1 \
36
+ {{if .Service.HostName}}--hostname={{.Service.HostName}} {{end}} \
37
{{range .Service.Volumes}}-v {{.}} {{end}} \
38
{{range .Service.Links}}--link {{.}} {{end}} \
39
{{range $key, $value := .Service.Environment}}-e {{$key}}="{{$value}}" {{end}} \
@@ -50,6 +51,7 @@ type ScriptDataTemplate struct {
50
51
// Service has the same structure used by docker-compose.yml
52
type Service struct {
53
Name string
54
+ HostName string
55
Image string
56
Ports []string
57
Volumes []string
0 commit comments