public class DockerFileUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator |
createInterpolator(MojoParameters params,
String filter)
Create an interpolator for the given maven parameters and filter configuration.
|
static Map<String,String> |
extractArgs(File dockerfile,
org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator interpolator)
Extract Args from dockerfile.
|
protected static Map<String,String> |
extractArgsFromLines(List<String[]> argLines)
Helper method for extractArgs(exposed for test)
|
static List<String> |
extractBaseImages(File dockerFile,
org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator interpolator)
Extract the base images from a dockerfile.
|
static String[] |
extractDelimiters(String filter) |
static List<String[]> |
extractLines(File dockerFile,
String keyword,
org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator interpolator)
Extract all lines containing the given keyword
|
static String |
interpolate(File dockerFile,
org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator interpolator)
Interpolate a docker file with the given properties and filter
|
static com.google.gson.JsonObject |
readDockerConfig() |
static Map<String,?> |
readKubeConfig() |
public static List<String> extractBaseImages(File dockerFile, org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator interpolator) throws IOException
FROM is
taken.dockerFile - file from where to extract the base imageinterpolator - interpolator for replacing propertiesIOExceptionpublic static Map<String,String> extractArgs(File dockerfile, org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator interpolator) throws IOException
dockerfile - Docker Fileinterpolator - interpolator for replacementIOExceptionpublic static List<String[]> extractLines(File dockerFile, String keyword, org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator interpolator) throws IOException
dockerFile - dockerfile to examinekeyword - keyword to extract the lines forinterpolator - interpolator for replacing propertiesIOExceptionpublic static String interpolate(File dockerFile, org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator interpolator) throws IOException
dockerFile - docker file to interpolateinterpolator - interpolator for replacing propertiesIOExceptionpublic static org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator createInterpolator(MojoParameters params, String filter)
params - The maven parameters.filter - The filter configuration.protected static Map<String,String> extractArgsFromLines(List<String[]> argLines)
argLines - list of string arrays containing lines with wordspublic static com.google.gson.JsonObject readDockerConfig()
Copyright © 2020. All rights reserved.