@@ -2,7 +2,8 @@ ARG JDK_VERSION="21"
22
33FROM ubuntu:latest as builder
44
5- LABEL maintainer="Zoë Gidiere <duplexsys@protonmail.com>"
5+
6+
67
78RUN 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-*; \
2930FROM ubuntu:latest
3031ARG 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+
3238ENV JAVA_HOME=/opt/java/graalvm
3339ENV PATH=$JAVA_HOME/bin:$PATH
3440
3541# Default to UTF-8 file.encoding
3642ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
3743
3844RUN 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" ]
0 commit comments