Add ARM64 support for distroless and ubuntu images (#66)

Co-authored-by: Luis Montoya <luiseduardom@microsoft.com>
This commit is contained in:
Luigi Montoya 2023-01-26 13:06:37 -08:00 коммит произвёл GitHub
Родитель 3294308522
Коммит bc98430d5b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 30 добавлений и 9 удалений

Просмотреть файл

@ -5,7 +5,7 @@ ARG BASE_TAG="2.0"
FROM ${INSTALLER_IMAGE}:${INSTALLER_TAG} AS installer
ARG JDK_URL="https://aka.ms/download-jdk/microsoft-jdk-11-linux-x64.tar.gz"
ARG JDK_URL="https://aka.ms/download-jdk/microsoft-jdk-11-linux-ARCH.tar.gz"
# Add dynamically linked packages: zlib
# Distroless base image already has tzdata ca-certificates openssl glibc
@ -22,6 +22,11 @@ RUN mkdir /staging \
# Get JDK
RUN mkdir -p /usr/lib/jvm && \
if [ $(uname -m) = "x86_64" ]; then \
JDK_URL=${JDK_URL/ARCH/x64}; \
else \
JDK_URL=${JDK_URL/ARCH/aarch64}; \
fi && \
curl --silent -L ${JDK_URL} -o /jdk.tar.gz && \
tar -xzf /jdk.tar.gz -C / && \
rm /jdk.tar.gz && \

Просмотреть файл

@ -5,7 +5,7 @@ ARG BASE_TAG="2.0"
FROM ${INSTALLER_IMAGE}:${INSTALLER_TAG} AS installer
ARG JDK_URL="https://aka.ms/download-jdk/microsoft-jdk-17-linux-x64.tar.gz"
ARG JDK_URL="https://aka.ms/download-jdk/microsoft-jdk-17-linux-ARCH.tar.gz"
# Add dynamically linked packages: zlib
# Distroless base image already has tzdata ca-certificates openssl glibc
@ -22,6 +22,11 @@ RUN mkdir /staging \
# Get JDK
RUN mkdir -p /usr/lib/jvm && \
if [ $(uname -m) = "x86_64" ]; then \
JDK_URL=${JDK_URL/ARCH/x64}; \
else \
JDK_URL=${JDK_URL/ARCH/aarch64}; \
fi && \
curl --silent -L ${JDK_URL} -o /jdk.tar.gz && \
tar -xzf /jdk.tar.gz -C / && \
rm /jdk.tar.gz && \

Просмотреть файл

@ -5,7 +5,7 @@ ARG BASE_TAG="2.0"
FROM ${INSTALLER_IMAGE}:${INSTALLER_TAG} AS installer
ARG JDK_URL="https://api.adoptium.net/v3/binary/latest/8/ga/linux/x64/jdk/hotspot/normal/eclipse?project=jdk"
ARG JDK_URL="https://api.adoptium.net/v3/binary/latest/8/ga/linux/ARCH/jdk/hotspot/normal/eclipse?project=jdk"
# Add dynamically linked packages: zlib
# Distroless base image already has tzdata ca-certificates openssl glibc
@ -22,6 +22,11 @@ RUN mkdir /staging \
# Get JDK
RUN mkdir -p /usr/lib/jvm && \
if [ $(uname -m) = "x86_64" ]; then \
JDK_URL=${JDK_URL/ARCH/x64}; \
else \
JDK_URL=${JDK_URL/ARCH/aarch64}; \
fi && \
curl --silent -L ${JDK_URL} -o /jdk.tar.gz && \
tar -xzf /jdk.tar.gz -C / && \
rm /jdk.tar.gz && \

Просмотреть файл

@ -26,8 +26,10 @@ RUN apt-get -qq update && \
apt-get -qq autoremove --purge && \
rm -rf /var/lib/apt/lists/* && \
echo java -Xshare:dump && \
java -Xshare:dump
java -Xshare:dump && \
if [ $(uname -m) = "x86_64" ]; then ARCH="amd64"; else ARCH="arm64"; fi && \
ln -s /usr/lib/jvm/msopenjdk-${JAVA_VERSION}-${ARCH} /usr/lib/jvm/msopenjdk-${JAVA_VERSION}
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-${JAVA_VERSION}-amd64
ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-${JAVA_VERSION}

Просмотреть файл

@ -23,7 +23,9 @@ RUN DEBIAN_FRONTEND=noninteractive && \
rm -rf /var/lib/apt/lists/* && \
echo java -Xshare:dump && \
java -Xshare:dump && \
rm -rf ./usr/lib/jvm/msopenjdk-11-amd64/lib/src.zip
if [ $(uname -m) = "x86_64" ]; then ARCH="amd64"; else ARCH="arm64"; fi && \
rm -rf ./usr/lib/jvm/msopenjdk-11-${ARCH}/lib/src.zip && \
ln -s /usr/lib/jvm/msopenjdk-11-${ARCH} /usr/lib/jvm/msopenjdk-11
RUN groupadd --system --gid=101 app \
&& adduser --uid 101 --gid 101 --system app \
@ -31,4 +33,4 @@ RUN groupadd --system --gid=101 app \
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-11-amd64
ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-11

Просмотреть файл

@ -23,7 +23,9 @@ RUN DEBIAN_FRONTEND=noninteractive && \
rm -rf /var/lib/apt/lists/* && \
echo java -Xshare:dump && \
java -Xshare:dump && \
rm -rf ./usr/lib/jvm/msopenjdk-17-amd64/lib/src.zip
if [ $(uname -m) = "x86_64" ]; then ARCH="amd64"; else ARCH="arm64"; fi && \
rm -rf ./usr/lib/jvm/msopenjdk-17-${ARCH}/lib/src.zip && \
ln -s /usr/lib/jvm/msopenjdk-17-${ARCH} /usr/lib/jvm/msopenjdk-17
RUN groupadd --system --gid=101 app \
&& adduser --uid 101 --gid 101 --system app \
@ -31,4 +33,4 @@ RUN groupadd --system --gid=101 app \
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-17-amd64
ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-17