Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
duplexsystem committed Sep 25, 2023
1 parent d059c64 commit 44342e3
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
FROM ubuntu:latest as builder

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends locales binutils \
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen en_US.UTF-8 \
&& DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential tar curl
RUN apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends locales binutils; \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \
locale-gen en_US.UTF-8; \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y; \
DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential tar curl

RUN LOCATION=$(curl -s https://api.github.com/repos/zlib-ng/zlib-ng/releases/latest \
| grep "tarball_url" \
| awk '{ print $2 }' \
| sed 's/,$//' \
| sed 's/"//g' ) \
; curl -L -o /tmp/zlib-ng.tar $LOCATION \
&& mkdir -p /tmp/ \
&& tar --extract \
; curl -L -o /tmp/zlib-ng.tar $LOCATION; \
mkdir -p /tmp/; \
tar --extract \
--file /tmp/zlib-ng.tar \
--directory "/tmp/"

RUN cd /tmp/zlib-ng-zlib-ng-* \
&& ./configure --zlib-compat \
&& make -j$(nproc); make install
RUN cd /tmp/zlib-ng-zlib-ng-*; \
./configure --zlib-compat; \
make -j$(nproc); make install

FROM ubuntu:latest

Expand All @@ -31,12 +31,12 @@ ENV PATH $JAVA_HOME/bin:$PATH

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata curl wget ca-certificates fontconfig locales binutils lsof curl openssl git tar sqlite3 fontconfig libfreetype6 iproute2 libstdc++6 libmimalloc2.0 \
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen en_US.UTF-8 \
&& DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata curl wget ca-certificates fontconfig locales binutils lsof curl openssl git tar sqlite3 fontconfig libfreetype6 iproute2 libstdc++6 libmimalloc2.0; \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \
locale-gen en_US.UTF-8; \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y; \
rm -rf /var/lib/apt/lists/*

RUN rm /lib/x86_64-linux-gnu/libz.*
COPY --from=builder /usr/local/lib/libz.* /lib/x86_64-linux-gnu/
Expand Down Expand Up @@ -67,11 +67,13 @@ RUN set -eux; \
# https://openjdk.java.net/jeps/341
java -Xshare:dump;

RUN echo Verifying install ... \
&& fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java \
&& echo javac --version && javac --version \
&& echo java --version && java --version \
&& echo Complete.
RUN echo Verifying install ...; \
fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \
echo javac --version; \
javac --version; \
echo java --version; \
java --version; \
echo Complete.

RUN useradd -d /home/container -m container

Expand Down

0 comments on commit 44342e3

Please sign in to comment.