Use Node IP in Swarm Standalone with "host" NetworkMode
This commit is contained in:
parent
7c4353a0ac
commit
d1d8b01dfb
3 changed files with 29 additions and 2 deletions
|
@ -39,6 +39,14 @@ func networkMode(mode string) func(*docker.ContainerJSON) {
|
|||
}
|
||||
}
|
||||
|
||||
func nodeIP(ip string) func(*docker.ContainerJSON) {
|
||||
return func(c *docker.ContainerJSON) {
|
||||
c.ContainerJSONBase.Node = &docker.ContainerNode{
|
||||
IPAddress: ip,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func labels(labels map[string]string) func(*docker.ContainerJSON) {
|
||||
return func(c *docker.ContainerJSON) {
|
||||
c.Config.Labels = labels
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue