refactor: simplify Docker entrypoints — agent bundles log appender
All checks were successful
CI / cleanup-branch (push) Has been skipped
CI / build (push) Successful in 1m54s
CI / docker (push) Successful in 1m16s
CI / deploy-feature (push) Has been skipped
CI / deploy (push) Successful in 57s
SonarQube / sonarqube (push) Successful in 4m0s

The agent shaded JAR now includes the log appender classes. Remove
PropertiesLauncher, -Dloader.path, and separate appender JAR references.

All JVM types now use: java -javaagent:/app/agent.jar -jar app.jar
Plain Java uses -cp with explicit main class. Native runs binary directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-16 01:20:48 +02:00
parent a4a5986f38
commit 3666994b9e
2 changed files with 8 additions and 13 deletions

View File

@@ -117,16 +117,11 @@ public class DockerRuntimeOrchestrator implements RuntimeOrchestrator {
String customArgs = request.customArgs() != null && !request.customArgs().isBlank()
? " " + request.customArgs() : "";
String entrypoint = switch (request.runtimeType()) {
case "quarkus" -> "exec java -javaagent:/app/agent.jar" + customArgs + " -jar " + appJarPath;
case "plain-java" -> "exec java -javaagent:/app/agent.jar -cp " + appJarPath +
":/app/cameleer-log-appender.jar" + customArgs + " " + request.mainClass();
case "plain-java" -> "exec java -javaagent:/app/agent.jar" + customArgs +
" -cp " + appJarPath + " " + request.mainClass();
case "native" -> "exec " + appJarPath + customArgs;
default -> { // spring-boot (default)
String launcher = request.mainClass() != null ? request.mainClass()
: "org.springframework.boot.loader.launch.PropertiesLauncher";
yield "exec java -javaagent:/app/agent.jar -Dloader.path=/app/cameleer-log-appender.jar" +
customArgs + " -cp " + appJarPath + " " + launcher;
}
default -> // spring-boot, quarkus, and others all use -jar
"exec java -javaagent:/app/agent.jar" + customArgs + " -jar " + appJarPath;
};
createCmd.withEntrypoint("sh", "-c", entrypoint);