diff --git a/probe/docker/container.go b/probe/docker/container.go index b5e89f8f8e..0f73773876 100644 --- a/probe/docker/container.go +++ b/probe/docker/container.go @@ -318,7 +318,10 @@ func (c *container) GetNode(hostID string, localAddrs []net.IP) report.Node { c.RLock() defer c.RUnlock() - ips := append(c.container.NetworkSettings.SecondaryIPAddresses, c.container.NetworkSettings.IPAddress) + ips := c.container.NetworkSettings.SecondaryIPAddresses + if c.container.NetworkSettings.IPAddress != "" { + ips = append(ips, c.container.NetworkSettings.IPAddress) + } // Treat all Docker IPs as local scoped. ipsWithScopes := []string{} for _, ip := range ips {