-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.jlink
26 lines (20 loc) · 906 Bytes
/
Dockerfile.jlink
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 1st stage, build the app
FROM maven:3.8.4-openjdk-17-slim as build
WORKDIR /helidon
# Create a first layer to cache the "Maven World" in the local repository.
# Incremental docker builds will always resume after that, unless you update
# the pom
ADD pom.xml .
RUN mvn package -Dmaven.test.skip -Declipselink.weave.skip
# Do the Maven build to create the custom Java Runtime Image
# Incremental docker builds will resume here when you change sources
ADD src src
# Don't generate CDS archive to work around JVM bug https://bugs.openjdk.org/browse/JDK-8274944
RUN mvn package -Pjlink-image -DskipTests -Djlink.image.addClassDataSharingArchive=false
RUN echo "done!"
# 2nd stage, build the final image with the JRI built in the 1st stage
FROM debian:stretch-slim
WORKDIR /helidon
COPY --from=build /helidon/target/helidon-quickstart-se-jri ./
ENTRYPOINT ["/bin/bash", "/helidon/bin/start"]
EXPOSE 8080