Skip to content

Commit

Permalink
feat(maven) add JDK11 to the JDK17 (#33)
Browse files Browse the repository at this point in the history
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
  • Loading branch information
dduportal authored Aug 10, 2022
1 parent a389a1f commit f6b0b60
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion maven/jdk17/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# Use Debian base
ARG JAVA_VERSION="11.0.16_8"
FROM eclipse-temurin:${JAVA_VERSION}-jdk-focal AS jdk11-build
# Generate smaller java runtime without unneeded files
# for now we include the full module path to maintain compatibility
# while still saving space (approx 200mb from the full distribution)
RUN jlink \
--add-modules ALL-MODULE-PATH \
--strip-debug \
--no-man-pages \
--no-header-files \
--compress=2 \
--output /javaruntime

# Use Debian base for both the agent and the resulting image (maven)
FROM jenkins/inbound-agent:jdk17-preview as jnlp

FROM maven:3.8.6-eclipse-temurin-17
Expand All @@ -17,6 +30,9 @@ RUN apt-get update && \
COPY --from=jnlp /usr/local/bin/jenkins-agent /usr/local/bin/jenkins-agent
COPY --from=jnlp /usr/share/jenkins/agent.jar /usr/share/jenkins/agent.jar

# Retrieve JDK11 for running jenkins agent process but do not use it as default
COPY --from=jdk11-build /javaruntime /opt/jdk-11

ENTRYPOINT ["/usr/local/bin/jenkins-agent"]

ARG user=jenkins
Expand Down

0 comments on commit f6b0b60

Please sign in to comment.