code: func (daemon *Daemon) getNetworkSandboxID(c *container.Container) (string, error) {
  	curr := c
  	for curr.HostConfig.NetworkMode.IsContainer() {
  		containerID := curr.HostConfig.NetworkMode.ConnectedContainer()
  		connected, err := daemon.GetContainer(containerID)
  		if err != nil {
  			return "", errors.Wrapf(err, "Could not get container for %s", containerID)
  		}
  		curr = connected
  	}
  	return curr.NetworkSettings.SandboxID, nil
  }
docs: // Resolve Network SandboxID in case the container reuse another container's network stack