From 250fff2b47bff2136fdb242e79fffb723b57df46 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Wed, 19 Feb 2025 11:38:38 +0400 Subject: [PATCH 1/2] fix: shell wrapper to handle signals --- Dockerfile.piped | 7 ++----- piped.sh | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100755 piped.sh diff --git a/Dockerfile.piped b/Dockerfile.piped index 6a31bb1..361ad2e 100644 --- a/Dockerfile.piped +++ b/Dockerfile.piped @@ -37,10 +37,7 @@ WORKDIR /app COPY --from=build /app/build/libs/piped-1.0-all.jar /app/piped.jar COPY --from=build /app/VERSION /app/VERSION -CMD java -server -Xmx${MAX_MEMORY:-1G} -Xaggressive \ - -XX:+UnlockExperimentalVMOptions -XX:+OptimizeStringConcat -XX:+UseStringDeduplication \ - -XX:+UseCompressedOops -XX:+UseNUMA -XX:+IdleTuningGcOnIdle -Xgcpolicy:gencon \ - -Xshareclasses:allowClasspaths -Xtune:virtualized -Xcompactgc \ - -jar /app/piped.jar +COPY ./piped.sh ./ +CMD ["/app/piped.sh"] # ------ diff --git a/piped.sh b/piped.sh new file mode 100755 index 0000000..47ba736 --- /dev/null +++ b/piped.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +java -server -Xmx${MAX_MEMORY:-1G} -Xaggressive \ + -XX:+UnlockExperimentalVMOptions -XX:+OptimizeStringConcat -XX:+UseStringDeduplication \ + -XX:+UseCompressedOops -XX:+UseNUMA -XX:+IdleTuningGcOnIdle -Xgcpolicy:gencon \ + -Xshareclasses:allowClasspaths -Xtune:virtualized -Xcompactgc \ + -jar /app/piped.jar & + +pid=$! + +trap "kill -INT $pid" INT +trap "kill -TERM $pid" TERM + +wait From 2e5a7247a76c832826422a1097271d33e18a71fb Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Wed, 19 Feb 2025 11:46:15 +0400 Subject: [PATCH 2/2] feat: add jre to PATH instead of symlinking --- Dockerfile.openj9 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile.openj9 b/Dockerfile.openj9 index accbadb..c28da77 100644 --- a/Dockerfile.openj9 +++ b/Dockerfile.openj9 @@ -47,9 +47,8 @@ RUN mv ./* /build/dist/ FROM ubuntu:24.10 AS run COPY --from=build /build/dist/jre /usr/lib/jvm/openj9-jre -RUN ln -s /usr/lib/jvm/openj9-jre/bin/java /usr/bin/java - ENV JAVA_HOME=/usr/lib/jvm/openj9-jre +ENV PATH="$JAVA_HOME/bin:$PATH" # verify installation RUN java --version