-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (23 loc) · 657 Bytes
/
Dockerfile
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
27
28
29
30
31
32
33
34
35
36
FROM jbangdev/jbang-action as build
ARG APP=app
WORKDIR /app
ADD * src/
RUN jbang build src/$APP.java ; \
jbang export portable src/$APP.java
RUN jlink \
--verbose \
--add-modules \
java.base,java.net.http \
--compress 2 --strip-debug --no-header-files --no-man-pages \
--output /app/java-minimal
FROM debian:buster-slim
ARG APP=app
EXPOSE 8080
WORKDIR /app
ENV APPJAR=$APP.jar
COPY --from=build /app/java-minimal ./java-minimal/
COPY --from=build /app/$APPJAR .
COPY --from=build /app/libs libs/
ENV JAVA_HOME=/app/java-minimal
ENV PATH="$PATH:$JAVA_HOME/bin"
ENTRYPOINT java -XX:+UseContainerSupport -jar $APPJAR