code: func ParseDockerRegistryURL(s string) (*DockerRegistryURL, error) {
  	registryURL, err := ParseFullDockerRegistryURL(s)
  	if err == nil {
  		return registryURL, nil
  	}
  	// String didn't parse but was supposed to be a full registry URL.
  	if strings.HasPrefix(s, "http://") || strings.HasPrefix(s, "https://") {
  		return nil, fmt.Errorf("Invalid full Docker registry URL: %s", err)
  	}
  
  	// At this point we have no scheme, possibly a host, possibly a port,
  	// possibly a repo, possibly an image name, and possibly a tag. We want to
  	// expand the Docker registry URL here, using HTTPS as a default scheme.
  	registryURL = &DockerRegistryURL{
  		Scheme: "https",
  	}
  
  	registryURLParts := strings.Split(s, "/")
  	if len(registryURLParts) == 3 {
  		// host[:port]/[repo/]image/[:tag]
  		host, port, err := splitHostPort(registryURLParts[0])
  		if err != nil {
  			return nil, err
  		}
  		registryURL.Host = host
  		registryURL.Port = port
  		s = path.Join(registryURLParts[1], registryURLParts[2])
  	}
  
  	if err = registryURL.parsePath(s); err != nil {
  		return nil, err
  	}
  	return registryURL, nil
  }
docs: // ParseDockerRegistryURL parses a Docker Registry URL. It does not need to be
  // a full URL. If the url starts with either http or https, the input path will
  // be passed to ParseFullDockerRegistryURL. If not, it will try to parse the
  // URL as if it is a (namespace/)*repo(:tag)?