code: func allocateDaemonPort(addr string) error {
  	host, port, err := net.SplitHostPort(addr)
  	if err != nil {
  		return err
  	}
  
  	intPort, err := strconv.Atoi(port)
  	if err != nil {
  		return err
  	}
  
  	var hostIPs []net.IP
  	if parsedIP := net.ParseIP(host); parsedIP != nil {
  		hostIPs = append(hostIPs, parsedIP)
  	} else if hostIPs, err = net.LookupIP(host); err != nil {
  		return fmt.Errorf("failed to lookup %s address in host specification", host)
  	}
  
  	pa := portallocator.Get()
  	for _, hostIP := range hostIPs {
  		if _, err := pa.RequestPort(hostIP, "tcp", intPort); err != nil {
  			return fmt.Errorf("failed to allocate daemon listening port %d (err: %v)", intPort, err)
  		}
  	}
  	return nil
  }
docs: // allocateDaemonPort ensures that there are no containers
  // that try to use any port allocated for the docker server.