-
-
Notifications
You must be signed in to change notification settings - Fork 115
Expand file tree
/
Copy pathDockerfile.build-base
More file actions
64 lines (57 loc) · 2.73 KB
/
Copy pathDockerfile.build-base
File metadata and controls
64 lines (57 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Build image for release artifacts. Not a dev container: dark-base is where
# you work, this is where things get published from.
#
# Old on purpose: an AOT binary inherits its glibc floor from the machine that
# builds it, and 24.04 would yield one that won't start on Debian 12, RHEL 9 or
# Amazon Linux 2023. 20.04 gives a floor of 2.29.
#
# Carries clang and cross sysroots because ilc links through a C compiler and
# gcc can't cross-target, so one x64 runner covers every linux artifact. macOS
# still needs a Mac.
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
# tzdata and libicu aren't optional: without them the SDK installs and then
# dies in TimeZoneInfo..cctor() on first use.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates curl unzip xz-utils git \
tzdata libicu66 \
clang lld \
gcc-aarch64-linux-gnu libc6-dev-arm64-cross \
gcc-arm-linux-gnueabihf libc6-dev-armhf-cross \
zlib1g-dev \
binutils \
# so the cross-built arm64 artifact can be run here rather than shipped unrun
qemu-user-static \
&& rm -rf /var/lib/apt/lists/*
# arm64 runtime libs, so the emulated smoke test gets past .NET dlopening
# OpenSSL. arm64 packages live on ports.ubuntu.com, hence pinning the existing
# sources to amd64 first.
RUN sed -i 's/^deb /deb [arch=amd64] /' /etc/apt/sources.list \
&& dpkg --add-architecture arm64 \
&& echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal main universe" \
> /etc/apt/sources.list.d/arm64.list \
&& echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-updates main universe" \
>> /etc/apt/sources.list.d/arm64.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends libssl1.1:arm64 libicu66:arm64 \
&& rm -rf /var/lib/apt/lists/*
# Pinned to match backend/global.json, which sets rollForward: disable.
# Anything else and dotnet refuses to run. Bump both together.
ARG DOTNET_SDK_VERSION=10.0.102
RUN curl -sSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh \
&& bash /tmp/dotnet-install.sh --version "${DOTNET_SDK_VERSION}" --install-dir /usr/share/dotnet \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
&& rm /tmp/dotnet-install.sh
# zig builds the SQLite static archives. Keep in step with the dev container.
ARG ZIG_VERSION=0.13.0
RUN curl -sSL "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz" -o /tmp/zig.tar.xz \
&& mkdir -p /root/zig \
&& tar -xf /tmp/zig.tar.xz -C /root/zig --strip-components=1 \
&& rm /tmp/zig.tar.xz
ENV PATH="/root/zig:${PATH}"
# Stops the build scripts re-entering a container; CI is already in this image.
ENV IN_DEV_CONTAINER=true
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
ENV DOTNET_NOLOGO=1
WORKDIR /root/app