Skip to content

Commit 0395557

Browse files
committed
Update deps and some fixes
1 parent 84f03e2 commit 0395557

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

Dockerfile

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ ARG JDK_VERSION="21"
22

33
FROM ubuntu:latest as builder
44

5-
LABEL maintainer="Zoë Gidiere <duplexsys@protonmail.com>"
5+
6+
67

78
RUN apt-get update; \
89
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends locales binutils; \
@@ -29,14 +30,19 @@ RUN cd /tmp/zlib-ng-zlib-ng-*; \
2930
FROM ubuntu:latest
3031
ARG JDK_VERSION
3132

33+
LABEL author="Zoë Gidiere" maintainer="duplexsys@protonmail.com"
34+
35+
LABEL org.opencontainers.image.source="https://github.com/duplexsystem/optimized-java-yolk"
36+
LABEL org.opencontainers.image.licenses=MIT
37+
3238
ENV JAVA_HOME=/opt/java/graalvm
3339
ENV PATH=$JAVA_HOME/bin:$PATH
3440

3541
# Default to UTF-8 file.encoding
3642
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
3743

3844
RUN DEBIAN_FRONTEND=noninteractive apt-get update; \
39-
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata curl wget ca-certificates fontconfig locales binutils lsof curl openssl git tar sqlite3 libfreetype6 iproute2 libstdc++6 libmimalloc2.0 git-lfs; \
45+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata curl wget ca-certificates fontconfig locales binutils lsof curl openssl git tar sqlite3 libfreetype6 iproute2 libstdc++6 libmimalloc2.0 git-lfs tini zip unzip; \
4046
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \
4147
locale-gen en_US.UTF-8; \
4248
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y; \
@@ -76,11 +82,15 @@ RUN echo Verifying install ...; \
7682
java --version; \
7783
echo Complete.
7884

79-
RUN useradd -d /home/container -m container
85+
## Setup user and working directory
86+
RUN useradd -m -d /home/container -s /bin/bash container
87+
USER container
88+
ENV USER=container HOME=/home/container LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libmimalloc.so.2 MIMALLOC_LARGE_OS_PAGES=1
89+
WORKDIR /home/container
8090

81-
USER container
82-
ENV USER=container HOME=/home/container LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libmimalloc.so.2.0 MIMALLOC_LARGE_OS_PAGES=1
83-
WORKDIR /home/container
91+
STOPSIGNAL SIGINT
8492

85-
COPY /entrypoint.sh /entrypoint.sh
86-
CMD [ "/bin/bash", "/entrypoint.sh" ]
93+
COPY --chown=container:container entrypoint.sh /entrypoint.sh
94+
RUN chmod +x /entrypoint.sh
95+
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
96+
CMD ["/entrypoint.sh"]

entrypoint.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ export INTERNAL_IP
3434
cd /home/container || exit 1
3535

3636
# Print Java version
37-
printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mjava -version\n"
37+
printf "\033[1m\033[33mcontainer@pelican~ \033[0mjava -version\n"
3838
java -version
3939

4040
# Convert all of the "{{VARIABLE}}" parts of the command into the expected shell
4141
# variable format of "${VARIABLE}" before evaluating the string and automatically
4242
# replacing the values.
43-
PARSED=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat -)")
43+
PARSED=$(echo "$STARTUP" | sed -e 's/{{/${/g' -e 's/}}/}/g')
4444

45-
# Display the command we're running in the output, and then execute it with the env
46-
# from the container itself.
47-
printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED"
45+
# Display the command we're running in the output, and then execute it with eval
46+
printf "\033[1m\033[33mcontainer@pelican~ \033[0m"
47+
echo "$PARSED"
4848
# shellcheck disable=SC2086
49-
exec env ${PARSED}
49+
eval "$PARSED"
5050

0 commit comments

Comments
 (0)