java.lang.Object
org.springframework.cloud.dataflow.registry.support.DockerImage

public class DockerImage extends Object
Docker image name parsing utility Code from https://github.com/vmware/admiral
  • Field Details

  • Constructor Details

    • DockerImage

      public DockerImage()
  • Method Details

    • fromImageName

      public static DockerImage fromImageName(String imageName)
      parse a full image name (myhost:300/namespace/repo:tag) into its components
      Parameters:
      imageName - the image name
      Returns:
      the corresponding DockerImage instance
    • fromParts

      public static DockerImage fromParts(String hostPart, String namespacePart, String repoAndTagPart)
    • fromParts

      public static DockerImage fromParts(String hostPart, String namespacePart, String repo, String tag)
    • isValidNamespace

      public static boolean isValidNamespace(String namespaceCandidate)
      When a image name part can be ambiguously either host or namespace, check which one it is based on a regex of valid characters for the namespace part
      Parameters:
      namespaceCandidate - candidate string for host or namespace
      Returns:
      true if namespace, false otherwise
    • getHost

      public String getHost()
      Returns:
      the host
    • getNamespace

      public String getNamespace()
      Returns:
      the namespace
    • getRepository

      public String getRepository()
      Returns:
      the repository
    • getNamespaceAndRepo

      public String getNamespaceAndRepo()
    • getTag

      public String getTag()
      Returns:
      the tag
    • isDockerHubImage

      public boolean isDockerHubImage()
    • toString

      public String toString()
      Convert to a canonical string representation. E.g.
      • from registry.hub.docker.com/library/alpine to alpine
      • from registry.hub.docker.com/mongons/mongo to mongons/mongo
      • from registry.local.corp/proj/image to registry.local.corp/proj/image
      Overrides:
      toString in class Object
      Returns:
      canonical string representation