Package dev.jeka.core.api.tooling.docker
Class JkDockerJvmBuild
java.lang.Object
dev.jeka.core.api.tooling.docker.JkDockerBuild
dev.jeka.core.api.tooling.docker.JkDockerJvmBuild
Docker Builder assistant for creating Docker images that run JVM applications.
Provides functionality tailored to JVM programs, such as setting classes, classpaths, agents, and Maven repositories for fetching tools.
Provides functionality tailored to JVM programs, such as setting classes, classpaths, agents, and Maven repositories for fetching tools.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class dev.jeka.core.api.tooling.docker.JkDockerBuild
JkDockerBuild.AddUserStatement, JkDockerBuild.DockerfileTemplate, JkDockerBuild.NonRootMode
-
Field Summary
FieldsFields inherited from class dev.jeka.core.api.tooling.docker.JkDockerBuild
dockerfileTemplate
-
Method Summary
Modifier and TypeMethodDescriptionadaptTo
(JkBuildable buildable) Adapts this JkDockerBuild instance to build the specified JkProject.Adds the specified agent to the running JVM, without passing any option.Adds the specified agent to the running JVMAdds the specified agent to the running JVMaddJvmOptions
(List<String> jvmOptions) Adds the specified JVM options to the Java process.void
buildImage
(Path contextDir, String imageName) Builds the Docker image with the specified image name.static JkDockerJvmBuild
of()
Creates ainstannce.
static JkDockerJvmBuild
of
(JkBuildable buildable) Creates a JkDockerBuild instance for the specified JkProject.Returns a formatted string that contains information about this Docker build.setClasses
(JkPathTree classes) Sets the compiled Java classes that constitute the Java program to be executed.setClasspath
(List<Path> classpath) Sets the jar files that constitute the classpath of the program to be executed.final JkDockerBuild
setDownloadMavenRepos
(JkRepoSet repos) Sets the Maven repository used for downloading agent jars.setMainClass
(String mainClass) Specifies the main class to run to execute the Program.Methods inherited from class dev.jeka.core.api.tooling.docker.JkDockerBuild
addFsOperation, addTokenResolver, buildImageInTemp, computeImportedFileRelativePath, generateContextDir, getBaseImage, getExposedPorts, getPortMappingArgs, hasNonRootUserCreation, renderDockerfile, setAddUserStatement, setAddUserStatement, setBaseImage, setExposedPorts, setGroupId, setNonRootUserCreationMode, setUserId, toDoubleQuotedArgs, toDoubleQuotedArgs
-
Field Details
-
DEFAULT_BASE_IMAGE
-
repos
-
-
Method Details
-
of
Creates ainstannce.
-
of
Creates a JkDockerBuild instance for the specified JkProject. -
buildImage
Description copied from class:JkDockerBuild
Builds the Docker image with the specified image name.- Overrides:
buildImage
in classJkDockerBuild
- Parameters:
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.
-
adaptTo
Adapts this JkDockerBuild instance to build the specified JkProject. -
setClasses
Sets the compiled Java classes that constitute the Java program to be executed. -
setClasspath
Sets the jar files that constitute the classpath of the program to be executed. -
setMainClass
Specifies the main class to run to execute the Program. -
addAgent
Adds the specified agent to the running JVM- Parameters:
file
- The agent jar file in the host systemagentOptions
- The agent options that will be prepended to '-javaagent:' option
-
addAgent
Adds the specified agent to the running JVM- Parameters:
agentCoordinate
- The agent maven coordinate to download agent.agentOptions
- The agent options that will be prepended to '-javaagent:' option
-
addAgent
Adds the specified agent to the running JVM, without passing any option.- Parameters:
agentCoordinate
- The agent maven coordinate to download agent.
-
addJvmOptions
Adds the specified JVM options to the Java process. -
setDownloadMavenRepos
Sets the Maven repository used for downloading agent jars. Initial value is Maven central. -
renderInfo
Returns a formatted string that contains information about this Docker build.- Overrides:
renderInfo
in classJkDockerBuild
-