-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (18 loc) · 707 Bytes
/
Dockerfile
File metadata and controls
25 lines (18 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM openjdk:17 as packager
# First stage: JDK 7 with modules required for Spring Boot
RUN /usr/java/openjdk-17/bin/jlink \
--module-path /usr/java/openjdk-17/jmods \
--verbose \
--add-modules java.base,java.logging,java.xml,jdk.unsupported,java.sql,java.naming,java.desktop,java.management,java.security.jgss,java.instrument \
--compress 2 \
--no-header-files \
--output /opt/jdk-17-minimal
# Second stage, add only our custom jdk9 distro and our app
FROM openjdk:17
COPY --from=packager /opt/jdk-17-minimal /opt/jdk-17-minimal
COPY target/*.jar /opt/
ENV JAVA_HOME=/opt/jdk-17-minimal
ENV PATH="$PATH:$JAVA_HOME/bin"
EXPOSE 8080
CMD java -jar /opt/*.jar
#CMD java --version