1
0
Fork 0

Fix traefik behavior when network_mode is host

This commit is contained in:
FuNK3Y 2020-02-11 11:56:05 +01:00 committed by GitHub
parent 115d42e0f0
commit 0c90f6afa2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View file

@ -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"
}