Konstantin Demin
90cef9a785
base: - add PSL (share among layers) - remove fontconfig (not so essential dependency) jdk: - keep fontconfig
87 lines
2.0 KiB
Docker
87 lines
2.0 KiB
Docker
ARG IMAGE_VERSION
|
|
FROM docker.io/rockdrilla/graalvm-debian:base-${IMAGE_VERSION} AS base
|
|
|
|
## ---
|
|
|
|
FROM base as jdk-fetch
|
|
SHELL [ "/bin/sh", "-ec" ]
|
|
|
|
ARG GRAALVM_BASE_FILE
|
|
COPY "/artifact-cache/${GRAALVM_BASE_FILE}" /tmp/graalvm.tar.gz
|
|
|
|
WORKDIR /opt/graalvm
|
|
|
|
RUN tar --strip-components=1 -xf /tmp/graalvm.tar.gz ; \
|
|
rm -rf \
|
|
GRAALVM-README.md \
|
|
license-information-user-manual.zip \
|
|
lib/security/cacerts \
|
|
lib/security/krb5.conf \
|
|
lib/security/public_suffix_list.dat \
|
|
; \
|
|
ln -sv /etc/ssl/certs/java/cacerts lib/security/ ; \
|
|
ln -sv /etc/krb5.conf lib/security/ ; \
|
|
ln -sv /usr/local/share/publicsuffix/public_suffix_list.dat lib/security/ ; \
|
|
find "${PWD}/" -name '*.so' -exec dirname '{}' '+' \
|
|
| sort -uV > ld.so.conf ; \
|
|
chmod -R go-w "${PWD}/"
|
|
|
|
## https://github.com/docker-library/openjdk/issues/212#issuecomment-420979840
|
|
## https://openjdk.java.net/jeps/341
|
|
ENV PATH="/opt/graalvm/bin:${PATH}" \
|
|
JAVA_HOME=/opt/graalvm
|
|
RUN ln -s "${PWD}/ld.so.conf" /etc/ld.so.conf.d/graalvm.conf ; \
|
|
ldconfig ; \
|
|
java -Xshare:dump
|
|
|
|
RUN find /tmp/ -mindepth 1 -ls -delete
|
|
|
|
## deduplicate (!)
|
|
RUN apt-install.sh jdupes ; \
|
|
apt-clean.sh ; \
|
|
echo ; \
|
|
du -xd1 "${PWD}/" | sort -Vk2 ; \
|
|
echo ; \
|
|
jdupes -1LSpr "${PWD}/" ; \
|
|
echo ; \
|
|
du -xd1 "${PWD}/" | sort -Vk2 ; \
|
|
echo
|
|
|
|
## ---
|
|
|
|
FROM base AS jdk
|
|
SHELL [ "/bin/sh", "-ec" ]
|
|
|
|
COPY /Dockerfile.jdk /usr/local/share/
|
|
|
|
ENV JAVA_HOME=/opt/graalvm
|
|
|
|
COPY --from=jdk-fetch "${JAVA_HOME}/" "${JAVA_HOME}/"
|
|
|
|
RUN ln -s "${JAVA_HOME}/ld.so.conf" /etc/ld.so.conf.d/graalvm.conf ; \
|
|
ldconfig
|
|
|
|
ENV PATH="${JAVA_HOME}/bin:${PATH}" \
|
|
MALLOC_ARENA_MAX=4
|
|
|
|
RUN apt-install.sh \
|
|
binutils \
|
|
curl \
|
|
elfutils \
|
|
fakechroot \
|
|
fakeroot \
|
|
faketime \
|
|
file \
|
|
fontconfig \
|
|
unzip \
|
|
wget \
|
|
xz-utils \
|
|
zip \
|
|
zstd \
|
|
; \
|
|
apt-clean.sh
|
|
|
|
## qa/smoke
|
|
RUN set -xv ; java -version ; \
|
|
find /tmp/ -mindepth 1 -ls -delete
|