Skip to content

Commit

Permalink
work on reducing layers
Browse files Browse the repository at this point in the history
  • Loading branch information
duplexsystem committed Sep 25, 2023
1 parent aff8513 commit cf1d5b2
Showing 1 changed file with 9 additions and 26 deletions.
35 changes: 9 additions & 26 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,15 @@ FROM clearlinux/os-core:latest
COPY --from=builder /install_root /


RUN rm /usr/lib64/libz.*; \
rm -f /usr/lib64/pkgconfig/zlib.pc; \
rm -f /usr/include/zlib.h; \
rm -f /usr/include/zconf.h; \
rm -f /usr/include/zlib_name_mangling.h
COPY --from=builder /usr/local/lib/libz.* /usr/lib64/
COPY --from=builder /usr/local/lib/pkgconfig/zlib.pc /usr/lib64/pkgconfig/
COPY --from=builder /usr/local/include/zlib.h /usr/include/
COPY --from=builder /usr/local/include/zconf.h /usr/include/
COPY --from=builder /usr/local/include/zlib_name_mangling.h /usr/include/

RUN rm -f /usr/lib64/libmimalloc.*; \
rm -rf /usr/lib64/mimalloc-*; \
rm -f /usr/lib64/pkgconfig/mimalloc.pc; \
rm -rf /usr/include/mimalloc-*
COPY --from=builder /usr/local/lib64/libmimalloc.* /usr/lib64/
COPY --from=builder /usr/local/lib64/mimalloc-* /usr/lib64/
COPY --from=builder /usr/local/lib64/pkgconfig/mimalloc.pc /usr/lib64/pkgconfig/
COPY --from=builder /usr/local/include/mimalloc-* /usr/include/

ENV JAVA_HOME /opt/java/graalvm
ENV PATH $JAVA_HOME/bin:$PATH

ENV JAVA_VERSION jdk-21+35
RUN rm -f /usr/lib64/libz.* /usr/lib64/pkgconfig/zlib.pc /usr/include/zlib.h /usr/include/zconf.h /usr/include/zlib_name_mangling.h /usr/lib64/libmimalloc.* /usr/lib64/pkgconfig/mimalloc.pc; \
rm -rf /usr/lib64/mimalloc-* /usr/include/mimalloc-*

COPY --from=builder /usr/local/lib/libz.* /usr/local/lib64/libmimalloc.* /usr/local/lib64/mimalloc-* /usr/lib64/
COPY --from=builder /usr/local/include/zlib.h /usr/local/include/zconf.h /usr/local/include/zlib_name_mangling.h /usr/local/include/mimalloc-* /usr/include/
COPY --from=builder /usr/local/lib/pkgconfig/zlib.pc /usr/local/lib64/pkgconfig/mimalloc.pc /usr/lib64/pkgconfig/

ENV JAVA_HOME=/opt/java/graalvm
ENV PATH=$JAVA_HOME/bin:$PATH JAVA_VERSION=jdk-21+35LD_PRELOAD=usr/lib64/libmimalloc.so MIMALLOC_LARGE_OS_PAGES=1

RUN set -eux; \
curl -o /tmp/graalvm.tar.gz https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_linux-x64_bin.tar.gz; \
Expand All @@ -112,8 +97,6 @@ RUN set -eux; \
# https://openjdk.java.net/jeps/341
java -Xshare:dump;

ENV LD_PRELOAD=usr/lib64/libmimalloc.so MIMALLOC_LARGE_OS_PAGES=1

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

0 comments on commit cf1d5b2

Please sign in to comment.