-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fill out matrix of Azure Linux images for net8.0 (#1261)
Adds Azure Linux variants of images used in the .NET 8 build.
- Loading branch information
Showing
16 changed files
with
370 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
ARG ANDROID_SDK_ROOT=/usr/local/android-sdk | ||
ARG ANDROID_NDK_VERSION=23.2.8568313 | ||
ARG ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/$ANDROID_NDK_VERSION | ||
FROM mcr.microsoft.com/openjdk/jdk:17-mariner AS android-sdk-download | ||
ARG ANDROID_SDK_ROOT | ||
ARG ANDROID_NDK_VERSION | ||
ARG ANDROID_NDK_ROOT | ||
|
||
# Dependencies for Android SDK install | ||
RUN tdnf update -y \ | ||
&& tdnf install -y \ | ||
# Android dependencies | ||
wget \ | ||
zip \ | ||
unzip | ||
|
||
# Grab the necessary Android SDK packages / tools | ||
RUN wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip \ | ||
&& echo "2d2d50857e4eb553af5a6dc3ad507a17adf43d115264b1afc116f95c92e5e258 commandlinetools-linux-11076708_latest.zip" | sha256sum -c \ | ||
&& mkdir -p /usr/local/cmdline-tools \ | ||
&& unzip commandlinetools-linux-11076708_latest.zip -d /usr/local/cmdline-tools \ | ||
&& rm -f commandlinetools-linux-11076708_latest.zip \ | ||
&& yes | /usr/local/cmdline-tools/cmdline-tools/bin/sdkmanager --sdk_root="${ANDROID_SDK_ROOT}" --licenses | ||
|
||
RUN yes | /usr/local/cmdline-tools/cmdline-tools/bin/sdkmanager --licenses | ||
RUN /usr/local/cmdline-tools/cmdline-tools/bin/sdkmanager --sdk_root="${ANDROID_SDK_ROOT}" --install "build-tools;33.0.0" "platforms;android-33" "ndk;${ANDROID_NDK_VERSION}" | ||
|
||
# We can't upgrade the NDK version as the runtime repo requires tooling that only exists up to NDK 23 | ||
# Remove all components of NDK 23 that are flagged by security scanners | ||
RUN rm -r ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/python3/lib/python3.9/site-packages/ \ | ||
&& rm -r ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang-tidy | ||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-llvm-amd64 | ||
|
||
# Install Microsoft OpenJDK from the Microsoft OpenJDK 17 Mariner image. | ||
ENV LANG=en_US.UTF-8 | ||
ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-17 | ||
ENV PATH=$JAVA_HOME/bin:$PATH | ||
COPY --from=mcr.microsoft.com/openjdk/jdk:17-mariner $JAVA_HOME $JAVA_HOME | ||
ARG ANDROID_SDK_ROOT | ||
ARG ANDROID_NDK_VERSION | ||
ARG ANDROID_NDK_ROOT | ||
|
||
|
||
# Dependencies for Android build | ||
RUN tdnf update -y \ | ||
&& tdnf install -y \ | ||
# Common dependencies | ||
binutils \ | ||
# Android dependencies | ||
zip \ | ||
unzip \ | ||
# linux-bionic build dependencies | ||
openssl-devel | ||
|
||
ENV ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT} | ||
ENV ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT} | ||
|
||
COPY --from=android-sdk-download $ANDROID_SDK_ROOT $ANDROID_SDK_ROOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-android-amd64 | ||
|
||
RUN tdnf update -y \ | ||
&& tdnf install -y \ | ||
moby-engine \ | ||
moby-cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-amd64 AS crossrootx64 | ||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-android-amd64 | ||
|
||
# Copy crossrootfs from AMD64 build image, so we can build Android-targeting code for that arch | ||
COPY --from=crossrootx64 /crossrootfs/x64 /crossrootfs/x64 |
19 changes: 19 additions & 0 deletions
19
src/azurelinux/3.0/net8.0/cross/freebsd/13/amd64/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ARG ROOTFS_DIR=/crossrootfs/x64 | ||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-builder-amd64 AS builder | ||
ARG ROOTFS_DIR | ||
|
||
# Install packages needed by the FreeBSD bootstrap scripts | ||
RUN tdnf install -y \ | ||
awk \ | ||
m4 && \ | ||
# The xz package in Azure Linux 3.0 doesn't provide liblzma.so, so we need to create a symlink to liblzma.so.5 | ||
# so the FreeBSD bootstrap can find it. See https://github.com/microsoft/azurelinux/issues/9217 | ||
ln -s /usr/lib/liblzma.so.5 /usr/lib/liblzma.so | ||
|
||
RUN /scripts/eng/common/cross/build-rootfs.sh freebsd13 x64 | ||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-llvm-amd64 | ||
ARG ROOTFS_DIR | ||
|
||
COPY --from=builder "$ROOTFS_DIR" "$ROOTFS_DIR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ARG ROOTFS_DIR=/crossrootfs/ppc64le | ||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-builder-amd64 AS builder | ||
ARG ROOTFS_DIR | ||
|
||
RUN /scripts/eng/common/cross/build-rootfs.sh bionic ppc64le | ||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-llvm-amd64 | ||
ARG ROOTFS_DIR | ||
|
||
COPY --from=builder "$ROOTFS_DIR" "$ROOTFS_DIR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
ARG ROOTFS_DIR=/crossrootfs/riscv64 | ||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-builder-amd64 AS builder | ||
ARG ROOTFS_DIR | ||
|
||
# Install the latest debootstrap | ||
RUN tdnf remove -y debootstrap && \ | ||
curl -fsL -o debootstrap.tar.gz https://deb.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.137.tar.gz && \ | ||
echo "666927457ee4b0b3e68e55a0efbf3fb69189610b7abbd534017d7032cb3ae833 debootstrap.tar.gz" | sha256sum -c - && \ | ||
tar xzf debootstrap.tar.gz -C / && \ | ||
ln -s /debootstrap/debootstrap -t /usr/local/bin && \ | ||
rm -f debootstrap.tar.gz | ||
|
||
RUN /scripts/eng/common/cross/build-rootfs.sh riscv64 noble --skipunmount | ||
|
||
RUN TARGET_TRIPLE="riscv64-linux-gnu" && \ | ||
CLANG_MAJOR_VERSION=$(clang --version | grep -oP "(?<=version )\d+") && \ | ||
cmake -S llvm-project.src/runtimes -B runtimes \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_ASM_COMPILER=clang \ | ||
-DCMAKE_C_COMPILER=clang \ | ||
-DCMAKE_CXX_COMPILER=clang++ \ | ||
-DCMAKE_ASM_COMPILER_TARGET="$TARGET_TRIPLE" \ | ||
-DCMAKE_C_COMPILER_TARGET="$TARGET_TRIPLE" \ | ||
-DCMAKE_CXX_COMPILER_TARGET="$TARGET_TRIPLE" \ | ||
# We're going to link the static libraries we build here into PIC images, so build the static libraries as PIC. | ||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \ | ||
-DCMAKE_SYSROOT="$ROOTFS_DIR" \ | ||
# Specify linker to use for exes directly for CMake toolchain detection | ||
-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ | ||
# Don't search for tools in the sysroot as we're cross-compiling | ||
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="NEVER" \ | ||
-DLLVM_USE_LINKER=lld \ | ||
-DLLVM_ENABLE_RUNTIMES="libcxx;compiler-rt" \ | ||
-DLIBCXX_ENABLE_SHARED=OFF \ | ||
-DLIBCXX_CXX_ABI=libstdc++ \ | ||
-DLIBCXX_CXX_ABI_INCLUDE_PATHS="$ROOTFS_DIR/usr/include/c++/13/;$ROOTFS_DIR/usr/include/$TARGET_TRIPLE" \ | ||
-DCOMPILER_RT_CXX_LIBRARY="libcxx" \ | ||
-DCOMPILER_RT_STATIC_CXX_LIBRARY=ON \ | ||
-DCOMPILER_RT_BUILD_SANITIZERS=OFF \ | ||
-DCOMPILER_RT_BUILD_MEMPROF=OFF \ | ||
# The libfuzzer build in LLVM doesn't correctly forward the required CMake properties to the "fuzzed libc++" build | ||
# so skip it here. | ||
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF \ | ||
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ | ||
-DCOMPILER_RT_INSTALL_PATH="/usr/local/lib/clang/$CLANG_MAJOR_VERSION" && \ | ||
cmake --build runtimes -j $(getconf _NPROCESSORS_ONLN) && \ | ||
cmake --install runtimes --prefix "$ROOTFS_DIR/usr" | ||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-llvm-amd64 | ||
ARG ROOTFS_DIR | ||
|
||
COPY --from=builder /usr/local/lib/clang /usr/local/lib/clang/ | ||
COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ARG ROOTFS_DIR=/crossrootfs/s390x | ||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-builder-amd64 AS builder | ||
ARG ROOTFS_DIR | ||
|
||
RUN /scripts/eng/common/cross/build-rootfs.sh bionic s390x | ||
|
||
# build ld from binutils since llvm's lld only supports s390x since 18.0 but we're using 16.0 | ||
# this can be removed once crossdeps-builder switches to llvm 18.0 | ||
RUN tdnf install -y awk && \ | ||
wget https://sourceware.org/pub/binutils/snapshots/binutils-2.41.90.tar.xz -O binutils.tar.xz && \ | ||
echo "6e990c6e40000acedb9928fa6b6a32a164f3119740a95c40e7a85c6461dbdda5 binutils.tar.xz" | sha256sum -c && \ | ||
mkdir binutils.src && \ | ||
tar -xf binutils.tar.xz --directory=binutils.src --strip-components=1 && \ | ||
cd binutils.src && \ | ||
./configure --target=s390x-linux-gnu --prefix=/binutils.install --disable-nls --disable-werror && \ | ||
make -j $(getconf _NPROCESSORS_ONLN) && \ | ||
make install -C ld | ||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-crossdeps-llvm-amd64 | ||
ARG ROOTFS_DIR | ||
|
||
COPY --from=builder "$ROOTFS_DIR" "$ROOTFS_DIR" | ||
COPY --from=builder /binutils.install/s390x-linux-gnu/bin/ld /usr/local/bin/s390x-linux-gnu-ld |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM mcr.microsoft.com/azurelinux/base/core:3.0 | ||
RUN tdnf install -y \ | ||
awk \ | ||
build-essential \ | ||
ca-certificates \ | ||
git \ | ||
icu \ | ||
rpm-build \ | ||
ruby \ | ||
# Provides useradd | ||
shadow-utils \ | ||
tar \ | ||
# Provides su | ||
util-linux \ | ||
# Provides sudo | ||
sudo \ | ||
&& tdnf clean all \ | ||
&& gem install fpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-amd64 | ||
|
||
# Dependencies for WebAssembly build | ||
RUN tdnf update -y \ | ||
&& tdnf install -y \ | ||
# WebAssembly build dependencies | ||
which \ | ||
nodejs \ | ||
npm \ | ||
python3 \ | ||
libxml2 \ | ||
unzip | ||
|
||
# WebAssembly build needs typescript | ||
RUN npm i -g typescript | ||
|
||
# Install V8 Engine | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
ENV V8_VERSION=10.8.168 | ||
RUN curl -sSL https://netcorenativeassets.blob.core.windows.net/resource-packages/external/linux/chromium-v8/v8-linux64-rel-${V8_VERSION}.zip -o ./v8.zip \ | ||
&& unzip ./v8.zip -d /usr/local/v8 \ | ||
&& echo $'#!/usr/bin/env bash\n\ | ||
"/usr/local/v8/d8" --snapshot_blob="/usr/local/v8/snapshot_blob.bin" "$@"\n' > /usr/local/bin/v8 \ | ||
&& chmod +x /usr/local/bin/v8 | ||
|
||
# Install Wasi toolchain | ||
ENV WASI_SDK_VERSION=22 | ||
ENV WASI_SDK_PATH=/usr/local/wasi-sdk | ||
ENV WASI_SDK_URL=https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-linux.tar.gz | ||
|
||
RUN mkdir -p ${WASI_SDK_PATH} \ | ||
&& cd /tmp \ | ||
&& curl -L -o /tmp/wasi-sdk.tar.gz ${WASI_SDK_URL} \ | ||
&& tar --strip-components=1 -xvzf /tmp/wasi-sdk.tar.gz -C ${WASI_SDK_PATH} \ | ||
&& echo ${WASI_SDK_VERSION} > ${WASI_SDK_PATH}/wasi-sdk-version.txt \ | ||
&& rm /tmp/wasi-sdk.tar.gz | ||
|
||
ENV WASMTIME_VERSION=19.0.2 | ||
ENV WASMTIME_PATH=/usr/local/wasmtime | ||
ENV WASMTIME_URL=https://github.com/bytecodealliance/wasmtime/releases/download/v${WASMTIME_VERSION}/wasmtime-v${WASMTIME_VERSION}-x86_64-linux.tar.xz | ||
|
||
RUN mkdir -p ${WASMTIME_PATH} \ | ||
&& cd /tmp \ | ||
&& curl -L -o /tmp/wasmtime.tar.xz ${WASMTIME_URL} \ | ||
&& tar --strip-components=1 -xvf /tmp/wasmtime.tar.xz -C ${WASMTIME_PATH} \ | ||
&& echo ${WASMTIME_VERSION} > ${WASMTIME_PATH}/wasmtime-version.txt \ | ||
&& rm /tmp/wasmtime.tar.xz \ | ||
&& ln -s ${WASMTIME_PATH}/wasmtime /bin/wasmtime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.