From 0aa33efa333b9bfec947e5bbe9a033ab5f3d9ebc Mon Sep 17 00:00:00 2001 From: djeang Date: Wed, 23 Oct 2024 20:09:59 +0200 Subject: [PATCH] Use eclipse-temurin:23-jre-alpine as default --- .../dev/jeka/core/api/tooling/docker/JkDockerJvmBuild.java | 3 ++- .../dev.jeka.samples.baseapp/jeka-src/_dev/BaseAppBuild.java | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dev.jeka.core/src/main/java/dev/jeka/core/api/tooling/docker/JkDockerJvmBuild.java b/dev.jeka.core/src/main/java/dev/jeka/core/api/tooling/docker/JkDockerJvmBuild.java index 3fb99aba0..b4cf74709 100644 --- a/dev.jeka.core/src/main/java/dev/jeka/core/api/tooling/docker/JkDockerJvmBuild.java +++ b/dev.jeka.core/src/main/java/dev/jeka/core/api/tooling/docker/JkDockerJvmBuild.java @@ -38,7 +38,7 @@ */ public class JkDockerJvmBuild extends JkDockerBuild { - public static final String BASE_IMAGE = "eclipse-temurin"; + public static final String BASE_IMAGE = "eclipse-temurin:23-jdk-alpine"; private static final Predicate CHANGING_LIB = path -> path.toString().endsWith("-SNAPSHOT.jar"); @@ -56,6 +56,7 @@ public class JkDockerJvmBuild extends JkDockerBuild { private JkDockerJvmBuild() { this.setBaseImage(BASE_IMAGE); + this.setAddUserTemplate(JkDockerBuild.ALPINE_ADD_USER_TEMPLATE); this.nonRootSteps.add(this::enhance); this.rootSteps.addNonRootMkdirs("/app", "/workdir"); this.rootSteps.add("WORKDIR /workdir"); diff --git a/samples/dev.jeka.samples.baseapp/jeka-src/_dev/BaseAppBuild.java b/samples/dev.jeka.samples.baseapp/jeka-src/_dev/BaseAppBuild.java index 034598529..5b5d8e348 100644 --- a/samples/dev.jeka.samples.baseapp/jeka-src/_dev/BaseAppBuild.java +++ b/samples/dev.jeka.samples.baseapp/jeka-src/_dev/BaseAppBuild.java @@ -1,5 +1,6 @@ package _dev; +import dev.jeka.core.api.tooling.docker.JkDockerBuild; import dev.jeka.core.api.tooling.intellij.JkIml; import dev.jeka.core.tool.JkInjectClasspath; import dev.jeka.core.tool.KBean; @@ -33,6 +34,7 @@ protected void init() { load(DockerKBean.class).customizeJvmImage(dockerBuild -> dockerBuild .addAgent("io.opentelemetry.javaagent:opentelemetry-javaagent:1.32.0", "") .setBaseImage("eclipse-temurin:21.0.1_12-jre-jammy") + .setAddUserTemplate(JkDockerBuild.TEMURIN_ADD_USER_TEMPLATE) .nonRootSteps.addCopy(getBaseDir().resolve("jeka.properties"), "/toto.txt", false) ); }