code: func (s *Service) NetworkConnect(ctx context.Context, c *container.Container, net *yaml.Network, oneOff bool) error {
  	containerID := c.ID()
  	client := s.clientFactory.Create(s)
  	internalLinks, err := s.getLinks()
  	if err != nil {
  		return err
  	}
  	links := []string{}
  	// TODO(vdemeester) handle link to self (?)
  	for k, v := range internalLinks {
  		links = append(links, strings.Join([]string{v, k}, ":"))
  	}
  	for _, v := range s.serviceConfig.ExternalLinks {
  		links = append(links, v)
  	}
  	aliases := []string{}
  	if !oneOff {
  		aliases = []string{s.Name()}
  	}
  	aliases = append(aliases, net.Aliases...)
  	if len(net.Aliases) >= 1 {
  		logrus.Infof("connect")
  		client.NetworkConnect(ctx, net.RealName, containerID, &network.EndpointSettings{
  			Aliases:   aliases,
  			Links:     links,
  			IPAddress: net.IPv4Address,
  			IPAMConfig: &network.EndpointIPAMConfig{
  				IPv4Address: net.IPv4Address,
  				IPv6Address: net.IPv6Address,
  			},
  		})
  		logrus.Infof("disconnect")
  		client.NetworkDisconnect(ctx, net.RealName, containerID, true)
  	}
  	return client.NetworkConnect(ctx, net.RealName, containerID, &network.EndpointSettings{
  		Aliases:   aliases,
  		Links:     links,
  		IPAddress: net.IPv4Address,
  		IPAMConfig: &network.EndpointIPAMConfig{
  			IPv4Address: net.IPv4Address,
  			IPv6Address: net.IPv6Address,
  		},
  	})
  }
docs: // NetworkConnect connects the container to the specified network
  // FIXME(vdemeester) will be refactor with Container refactoring