Fix host Docker network
Signed-off-by: Emile Vauge <emile@vauge.com>
This commit is contained in:
parent
6e5a221180
commit
050416224d
1 changed files with 6 additions and 1 deletions
|
@ -270,7 +270,12 @@ func (provider *Docker) getIPAddress(container dockertypes.ContainerJSON) string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, network := range container.NetworkSettings.Networks {
|
for networkName, network := range container.NetworkSettings.Networks {
|
||||||
|
// If net==host, quick n' dirty, we return 127.0.0.1
|
||||||
|
// This will work locally, but will fail with swarm.
|
||||||
|
if "host" == networkName {
|
||||||
|
return "127.0.0.1"
|
||||||
|
}
|
||||||
return network.IPAddress
|
return network.IPAddress
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
|
|
Loading…
Reference in a new issue