-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #151 add jdk 17 docker file and update build.sh
- Loading branch information
Showing
5 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
FROM openjdk:11.0.3-slim | ||
ADD /target/light-proxy.jar server.jar | ||
CMD ["/bin/sh","-c","java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 -Dlight-4j-config-dir=/config -Dlogback.configurationFile=/config/logback.xml -jar /server.jar"] | ||
CMD ["/bin/sh","-c","exec java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 -Dlight-4j-config-dir=/config -Dlogback.configurationFile=/config/logback.xml -jar /server.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
FROM openjdk:11.0.3-slim | ||
ADD /target/light-gateway.jar server.jar | ||
CMD ["/bin/sh","-c","java -Dlight-4j-config-dir=/config -Dlogback.configurationFile=/config/logback.xml -jar /server.jar"] | ||
CMD ["/bin/sh","-c","exec java -Dlight-4j-config-dir=/config -Dlogback.configurationFile=/config/logback.xml -jar /server.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
FROM amazoncorretto:17-alpine as corretto-jdk | ||
|
||
RUN { \ | ||
java --version ; \ | ||
echo "jlink version:" && \ | ||
$JAVA_HOME/bin/jlink --version ; \ | ||
} | ||
|
||
# required for strip-debug to work | ||
RUN apk add --no-cache binutils | ||
|
||
# build modules distribution | ||
RUN $JAVA_HOME/bin/jlink \ | ||
--verbose \ | ||
--add-modules \ | ||
java.base,java.sql,java.naming,java.desktop,java.xml,jdk.crypto.cryptoki,jdk.crypto.ec,jdk.unsupported,java.management,java.security.jgss,java.net.http,java.net.http \ | ||
--compress 2 \ | ||
--strip-debug \ | ||
--no-header-files \ | ||
--no-man-pages \ | ||
--output /customjre | ||
|
||
# Second stage, add only our minimal "JRE" distr and our app | ||
FROM alpine | ||
|
||
ENV JAVA_HOME=/jre | ||
ENV PATH="${JAVA_HOME}/bin:${PATH}" | ||
|
||
# copy JRE from the base image | ||
COPY --from=corretto-jdk /customjre $JAVA_HOME | ||
|
||
# Add app user | ||
ARG APPLICATION_USER=appuser | ||
RUN adduser --no-create-home -u 1000 -D $APPLICATION_USER | ||
|
||
# Configure working directory | ||
RUN mkdir /app && \ | ||
chown -R $APPLICATION_USER /app | ||
|
||
USER 1000 | ||
|
||
COPY --chown=1000:1000 /target/light-gateway.jar /app/server.jar | ||
|
||
WORKDIR /app | ||
|
||
CMD ["/bin/sh","-c","exec java -Dlight-4j-config-dir=/config -Dlogback.configurationFile=/config/logback.xml -jar /app/server.jar"] |