Class DockerImage
java.lang.Object
org.springframework.cloud.dataflow.registry.support.DockerImage
Docker image name parsing utility Code from https://github.com/vmware/admiral
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic DockerImage
fromImageName
(String imageName) parse a full image name (myhost:300/namespace/repo:tag) into its componentsstatic DockerImage
static DockerImage
getHost()
getTag()
boolean
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 parttoString()
Convert to a canonical string representation.
-
Field Details
-
SECTION_SEPARATOR
- See Also:
-
TAG_SEPARATOR
- See Also:
-
DEFAULT_NAMESPACE
- See Also:
-
DEFAULT_TAG
- See Also:
-
-
Constructor Details
-
DockerImage
public DockerImage()
-
-
Method Details
-
fromImageName
parse a full image name (myhost:300/namespace/repo:tag) into its components- Parameters:
imageName
- the image name- Returns:
- the corresponding DockerImage instance
-
fromParts
-
fromParts
-
isValidNamespace
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
- Returns:
- the host
-
getNamespace
- Returns:
- the namespace
-
getRepository
- Returns:
- the repository
-
getNamespaceAndRepo
-
getTag
- Returns:
- the tag
-
isDockerHubImage
public boolean isDockerHubImage() -
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
-