code: func (c *container) connectWithNetworks(adHoc bool) {
  	containerNetworks := c.Networks()
  	for name, params := range containerNetworks {
  		network := cfg.Network(name)
  		if network == nil {
  			panic(StatusError{fmt.Errorf("Error when parsing network `%v`: container network is not in main networks block.\n", name), 78})
  		}
  		networkName := network.ActualName()
  		args := []string{"network", "connect"}
  		for _, alias := range params.Alias(c.Name()) {
  			args = append(args, "--alias", alias)
  		}
  		if len(params.Ip()) > 0 {
  			args = append(args, "--ip", params.Ip())
  		}
  		if len(params.Ip6()) > 0 {
  			args = append(args, "--ip6", params.Ip6())
  		}
  		args = append(args, networkName, c.ActualName(adHoc))
  		executeCommand("docker", args, c.CommandsOut(), c.CommandsErr())
  	}
  }
docs: // Connects container with default network if required,
  // using the non-prefixed name as an alias