Skip to content

Commit

Permalink
#25584 ms java (#25585)
Browse files Browse the repository at this point in the history
Co-authored-by: Jose Castro <jose.castro@dotcms.com>
  • Loading branch information
wezell and jcastro-dotcms committed Aug 24, 2023
1 parent 2cdfd50 commit 4d496cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docker/dotcms/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 3 additions & 8 deletions docker/java-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand All @@ -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 \
Expand All @@ -63,4 +59,3 @@ RUN rm -rf /root/.sdkman && \
# ----------------------------------------------
FROM scratch
COPY --from=base-builder / /

0 comments on commit 4d496cd

Please sign in to comment.