Fork me on GitHub

mn:docker-crac

Full name:

io.micronaut.maven:micronaut-maven-plugin:4.7.1:docker-crac

Description:

Implementation of the docker-crac packaging.

WARNING: this goal is not intended to be executed directly. Instead, specify the packaging type using the packaging property, eg:

mvn package -Dpackaging=docker-crac

This is a two stage process. First a docker image is built that runs the application under a CRaC enabled JDK. Then the application is warmed up via a shell script. And then a checkpoint is taken via a signal using jcmd.

The second stage takes this checkpoint, and creates the final image containing it plus a run script which passes the correct flags to the CRaC enabled JDK.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: compile+runtime.
  • The goal is not marked as thread-safe and thus does not support parallel builds.
  • Since version: 3.5.0.

Required Parameters

Name Type Since Description
<mainClass> String - The main class of the application, as defined in the Exec Maven Plugin.
Default: ${exec.mainClass}

Optional Parameters

Name Type Since Description
<appArguments> List<String> - List of additional arguments that will be passed to the application.
User Property: mn.appArgs
<baseImageRun> String 1.2 The Docker image used to run the native image.
Default: cgr.dev/chainguard/wolfi-base:latest
User Property: micronaut.native-image.base-image-run
<checkpointNetworkName> String - The name of the docker network to run the checkpoint container in.
User Property: crac.checkpoint.network
<checkpointTimeoutSeconds> Integer - The timeout in seconds to wait for the checkpoint to complete.
Default: 60
User Property: crac.checkpoint.timeout
<cracArchitecture> String - The architecture to use for the CRaC enabled JDK. Defaults to os.arch
User Property: crac.arch
<cracJavaVersion> String - The version of the Azul CRaC enabled JDK to use.
Default: ${jdk.version}
User Property: crac.java.version
<cracOs> String - The os to use for the CRaC enabled JDK.
Default: linux-glibc
User Property: crac.os
<micronautRuntime> String - The target runtime of the application.
Default: NONE
User Property: micronaut.runtime
<nativeImageBuildArgs> List<String> - Additional arguments that will be passed to the native-image executable. Note that this will only be used when using a packaging of type docker-native. For native-image packaging you should use the Native Image Maven Plugin configuration options.
User Property: micronaut.native-image.args
<networkMode> String 4.0.0 Networking mode for the RUN instructions during build.
User Property: docker.networkMode
<oracleLinuxVersion> String - The version of Oracle Linux to use as a native-compile base when building a native image inside a Docker container.
Default: ol9
User Property: micronaut.native-image.ol.version
<readinessCommand> String - The command to execute to determine if the application is ready to receive traffic.
Default: curl --output /dev/null --silent --head http://localhost:8080
User Property: crac.readiness
<staticNativeImage> Boolean - Whether to produce a static native image when using docker-native packaging.
Default: false
User Property: micronaut.native-image.static

Parameter Details

<appArguments>

List of additional arguments that will be passed to the application.
  • Type: java.util.List<java.lang.String>
  • Required: No
  • User Property: mn.appArgs

<baseImageRun>

The Docker image used to run the native image.
  • Type: java.lang.String
  • Since: 1.2
  • Required: No
  • User Property: micronaut.native-image.base-image-run
  • Default: cgr.dev/chainguard/wolfi-base:latest

<checkpointNetworkName>

The name of the docker network to run the checkpoint container in.
  • Type: java.lang.String
  • Required: No
  • User Property: crac.checkpoint.network

<checkpointTimeoutSeconds>

The timeout in seconds to wait for the checkpoint to complete.
  • Type: java.lang.Integer
  • Required: No
  • User Property: crac.checkpoint.timeout
  • Default: 60

<cracArchitecture>

The architecture to use for the CRaC enabled JDK. Defaults to os.arch
  • Type: java.lang.String
  • Required: No
  • User Property: crac.arch

<cracJavaVersion>

The version of the Azul CRaC enabled JDK to use.
  • Type: java.lang.String
  • Required: No
  • User Property: crac.java.version
  • Default: ${jdk.version}

<cracOs>

The os to use for the CRaC enabled JDK.
  • Type: java.lang.String
  • Required: No
  • User Property: crac.os
  • Default: linux-glibc

<mainClass>

The main class of the application, as defined in the Exec Maven Plugin.
  • Type: java.lang.String
  • Required: Yes
  • Default: ${exec.mainClass}

<micronautRuntime>

The target runtime of the application.
  • Type: java.lang.String
  • Required: No
  • User Property: micronaut.runtime
  • Default: NONE

<nativeImageBuildArgs>

Additional arguments that will be passed to the native-image executable. Note that this will only be used when using a packaging of type docker-native. For native-image packaging you should use the Native Image Maven Plugin configuration options.
  • Type: java.util.List<java.lang.String>
  • Required: No
  • User Property: micronaut.native-image.args

<networkMode>

Networking mode for the RUN instructions during build.
  • Type: java.lang.String
  • Since: 4.0.0
  • Required: No
  • User Property: docker.networkMode

<oracleLinuxVersion>

The version of Oracle Linux to use as a native-compile base when building a native image inside a Docker container.
  • Type: java.lang.String
  • Required: No
  • User Property: micronaut.native-image.ol.version
  • Default: ol9

<readinessCommand>

The command to execute to determine if the application is ready to receive traffic.
  • Type: java.lang.String
  • Required: No
  • User Property: crac.readiness
  • Default: curl --output /dev/null --silent --head http://localhost:8080

<staticNativeImage>

Whether to produce a static native image when using docker-native packaging.
  • Type: java.lang.Boolean
  • Required: No
  • User Property: micronaut.native-image.static
  • Default: false