Fix traefik behavior when network_mode is host
This commit is contained in:
parent
115d42e0f0
commit
0c90f6afa2
2 changed files with 17 additions and 0 deletions
|
@ -259,6 +259,9 @@ func (p Provider) getIPAddress(ctx context.Context, container dockerData) string
|
|||
if container.Node != nil && container.Node.IPAddress != "" {
|
||||
return container.Node.IPAddress
|
||||
}
|
||||
if host, err := net.LookupHost("host.docker.internal"); err == nil {
|
||||
return host[0]
|
||||
}
|
||||
return "127.0.0.1"
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue