Package io.fabric8.maven.docker.util
Class ContainerNamingUtil
- java.lang.Object
-
- io.fabric8.maven.docker.util.ContainerNamingUtil
-
public class ContainerNamingUtil extends Object
- Since:
- 1.0.0
- Author:
- marcus
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_CONTAINER_NAME_PATTERN
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringformatContainerName(ImageConfiguration image, String defaultContainerNamePattern, Date buildTimestamp, Collection<Container> existingContainers)static Collection<Container>getContainersToStop(ImageConfiguration image, String defaultContainerNamePattern, Date buildTimestamp, Collection<Container> containers)Keep only the entry with the higest index if an indexed naming scheme for container has been chosen or if the container name pattern doesn't contain any index placeholders then filter containers (analogformatContainerName(ImageConfiguration, String, Date, Collection)but with stopping them in mind).
The placeholders of the containerNamePattern are resolved as follows:
%a is replaced with the image alias %n is replaced with the image name %t is replaced with any date (regex \d{10,}) %i is replaced with any number (regex \d+)
-
-
-
Field Detail
-
DEFAULT_CONTAINER_NAME_PATTERN
public static final String DEFAULT_CONTAINER_NAME_PATTERN
- See Also:
- Constant Field Values
-
-
Method Detail
-
formatContainerName
public static String formatContainerName(ImageConfiguration image, String defaultContainerNamePattern, Date buildTimestamp, Collection<Container> existingContainers)
-
getContainersToStop
public static Collection<Container> getContainersToStop(ImageConfiguration image, String defaultContainerNamePattern, Date buildTimestamp, Collection<Container> containers)
Keep only the entry with the higest index if an indexed naming scheme for container has been chosen or if the container name pattern doesn't contain any index placeholders then filter containers (analogformatContainerName(ImageConfiguration, String, Date, Collection)but with stopping them in mind).
The placeholders of the containerNamePattern are resolved as follows:
- %a is replaced with the image alias
- %n is replaced with the image name
- %t is replaced with any date (regex \d{10,})
- %i is replaced with any number (regex \d+)
- Parameters:
image- the image from which to the the container patternbuildTimestamp- the timestamp for the buildcontainers- the list of existing containers- Returns:
- filtered container instances, maybe empty but never null
-
-