Skip to content

Commit

Permalink
Set JAVA_APP_DIR env var when necessary
Browse files Browse the repository at this point in the history
When using Jib to build the container image
(and the defaults have not been changed),
JAVA_APP_DIR should be present in order to
avoid situations where agent jars cannot
be located.

Fixes: #39022
(cherry picked from commit 05fd6ff)
  • Loading branch information
geoand authored and gsmet committed Feb 27, 2024
1 parent f28c605 commit 6b62516
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ private JibContainerBuilder createContainerBuilderFromFastJar(String baseJvmImag
// which would mean AppCDS would not be taken into account at all
entrypoint = List.of(RUN_JAVA_PATH);
envVars.put("JAVA_APP_JAR", workDirInContainer + "/" + JarResultBuildStep.QUARKUS_RUN_JAR);
envVars.put("JAVA_APP_DIR", workDirInContainer.toString());
envVars.put("JAVA_OPTS_APPEND", String.join(" ", determineEffectiveJvmArguments(jibConfig, appCDSResult)));
} else {
List<String> effectiveJvmArguments = determineEffectiveJvmArguments(jibConfig, appCDSResult);
Expand Down

0 comments on commit 6b62516

Please sign in to comment.