public class JkDockerJvmBuild extends JkDockerBuild
Modifier and Type | Class and Description |
---|---|
static class |
JkDockerJvmBuild.PopularBaseImage |
JkDockerBuild.AddUserStatement, JkDockerBuild.DockerfileTemplate, JkDockerBuild.NonRootMode
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_BASE_IMAGE |
protected JkRepoSet |
repos |
dockerfileTemplate
Modifier and Type | Method and Description |
---|---|
JkDockerJvmBuild |
adaptTo(JkBuildable buildable)
Adapts this JkDockerBuild instance to build the specified JkProject.
|
JkDockerJvmBuild |
addAgent(java.nio.file.Path file,
java.lang.String agentOptions)
Adds the specified agent to the running JVM
|
JkDockerJvmBuild |
addAgent(java.lang.String agentCoordinate)
Adds the specified agent to the running JVM, without passing any option.
|
JkDockerJvmBuild |
addAgent(java.lang.String agentCoordinate,
java.lang.String agentOptions)
Adds the specified agent to the running JVM
|
JkDockerJvmBuild |
addJvmOptions(java.util.List<java.lang.String> jvmOptions)
Adds the specified JVM options to the Java process.
|
void |
buildImage(java.nio.file.Path contextDir,
java.lang.String imageName)
Builds the Docker image with the specified image name.
|
static JkDockerJvmBuild |
of()
Creates a
instannce. |
static JkDockerJvmBuild |
of(JkBuildable buildable)
Creates a JkDockerBuild instance for the specified JkProject.
|
java.lang.String |
renderInfo()
Returns a formatted string that contains information about this Docker build.
|
JkDockerJvmBuild |
setClasses(JkPathTree classes)
Sets the compiled Java classes that constitute the Java program to be executed.
|
JkDockerJvmBuild |
setClasspath(java.util.List<java.nio.file.Path> classpath)
Sets the jar files that constitute the classpath of the program to be executed.
|
JkDockerBuild |
setDownloadMavenRepos(JkRepoSet repos)
Sets the Maven repository used for downloading agent jars.
|
JkDockerJvmBuild |
setMainClass(java.lang.String mainClass)
Specifies the main class to run to execute the Program.
|
addFsOperation, addTokenResolver, buildImageInTemp, computeImportedFileRelativePath, generateContextDir, getBaseImage, getExposedPorts, getPortMappingArgs, hasNonRootUserCreation, renderDockerfile, setAddUserStatement, setAddUserStatement, setBaseImage, setExposedPorts, setGroupId, setNonRootUserCreationMode, setUserId, toDoubleQuotedArgs, toDoubleQuotedArgs
public static final java.lang.String DEFAULT_BASE_IMAGE
protected JkRepoSet repos
public static JkDockerJvmBuild of()
instannce.
public static JkDockerJvmBuild of(JkBuildable buildable)
public void buildImage(java.nio.file.Path contextDir, java.lang.String imageName)
JkDockerBuild
buildImage
in class JkDockerBuild
contextDir
- the directory where the Dockerfile will be generated and from which COPY paths will be resolved.imageName
- the name of the image to build. It may include a tag name.public JkDockerJvmBuild adaptTo(JkBuildable buildable)
public JkDockerJvmBuild setClasses(JkPathTree classes)
public JkDockerJvmBuild setClasspath(java.util.List<java.nio.file.Path> classpath)
public JkDockerJvmBuild setMainClass(java.lang.String mainClass)
public JkDockerJvmBuild addAgent(java.nio.file.Path file, java.lang.String agentOptions)
file
- The agent jar file in the host systemagentOptions
- The agent options that will be prepended to '-javaagent:' optionpublic JkDockerJvmBuild addAgent(java.lang.String agentCoordinate, java.lang.String agentOptions)
agentCoordinate
- The agent maven coordinate to download agent.agentOptions
- The agent options that will be prepended to '-javaagent:' optionpublic JkDockerJvmBuild addAgent(java.lang.String agentCoordinate)
agentCoordinate
- The agent maven coordinate to download agent.public JkDockerJvmBuild addJvmOptions(java.util.List<java.lang.String> jvmOptions)
public final JkDockerBuild setDownloadMavenRepos(JkRepoSet repos)
public java.lang.String renderInfo()
renderInfo
in class JkDockerBuild