From 4d496cda51240ddf8ece5cf5c8d8d5db45493aa1 Mon Sep 17 00:00:00 2001 From: Will Ezell Date: Wed, 23 Aug 2023 23:44:33 -0400 Subject: [PATCH] #25584 ms java (#25585) Co-authored-by: Jose Castro --- docker/dotcms/Dockerfile | 2 +- docker/java-base/Dockerfile | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/docker/dotcms/Dockerfile b/docker/dotcms/Dockerfile index 5e17ad4f65e6..907f6316e9d1 100644 --- a/docker/dotcms/Dockerfile +++ b/docker/dotcms/Dockerfile @@ -40,7 +40,7 @@ RUN ln -s $(ls -d /srv/dotserver/tomcat-*) /srv/dotserver/tomcat # Stage 2: Construct our container using the minimal-java image # and copying the prebuilt dotcms # ---------------------------------------------- -FROM dotcms/java-base:11.0.17-amzn as container-base +FROM dotcms/java-base:ms-jdk-11 as container-base WORKDIR /srv diff --git a/docker/java-base/Dockerfile b/docker/java-base/Dockerfile index 9874a2ca1870..c8d05d13b2ec 100644 --- a/docker/java-base/Dockerfile +++ b/docker/java-base/Dockerfile @@ -1,7 +1,7 @@ # ---------------------------------------------- # Stage 1: Minimal java image with sdkman + Ubuntu LTS # ---------------------------------------------- -FROM ubuntu:20.04 as base-builder +FROM mcr.microsoft.com/openjdk/jdk:11-ubuntu as base-builder WORKDIR /srv @@ -23,7 +23,7 @@ RUN wget -O - https://repo.dotcms.com/artifactory/ext-release-local/com/dotcms/c chmod a+x /usr/bin/curl # Downloading sdkman -RUN curl -sL "https://get.sdkman.io" | bash +#RUN curl -sL "https://get.sdkman.io" | bash # Installing Java via sdkman # Modules included @@ -38,11 +38,7 @@ RUN curl -sL "https://get.sdkman.io" | bash # jdk.compiler needed to build # jdk.zipfs needed for gradle -RUN bash -c "source /root/.sdkman/bin/sdkman-init.sh && \ - sdk list java && \ - yes | sdk install java $JAVA_VERSION " && \ - # Create a java runtime image to run dotCMS - /root/.sdkman/candidates/java/$JAVA_VERSION/bin/jlink \ +RUN jlink \ --verbose \ --add-modules \ java.base,jdk.crypto.ec,jdk.jdwp.agent,jdk.management,java.sql,java.naming,java.desktop,java.management,java.security.jgss,java.instrument,jdk.unsupported,java.scripting,java.rmi,jdk.compiler,jdk.zipfs,jdk.naming.dns,jdk.localedata,java.xml,jdk.xml.dom \ @@ -63,4 +59,3 @@ RUN rm -rf /root/.sdkman && \ # ---------------------------------------------- FROM scratch COPY --from=base-builder / / -