Build musl and glibc for amd64 and arm64 through one native package path. Reuse musl outputs for OCI images and OpenWrt installers, and export binaries inside a rootless unshare session. Restore the executable dependency graph into a shared persistent NuGet cache, build managed dependencies once, and run isolated native publishes in parallel. Clean temporary outputs and expired image layers under store locks, retire inactive legacy stores after seven days, and retain two toolchain exports. Add regression coverage for staging, extraction, packaging and cleanup boundaries.
39 lines
1.9 KiB
Docker
39 lines
1.9 KiB
Docker
# Shared .NET 10 NativeAOT build environment for MoShiro's Linux node images.
|
|
# The SDK image includes the Linux NativeAOT compiler prerequisites. Warm the
|
|
# repository-pinned AotAnywhere MSBuild SDK into this image so builds do not
|
|
# depend on a writable host-mounted NuGet cache.
|
|
FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/sdk:10.0-noble-aot
|
|
|
|
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 \
|
|
DOTNET_NOLOGO=1 \
|
|
NUGET_PACKAGES=/root/.nuget/packages
|
|
|
|
WORKDIR /opt/aotanywhere
|
|
COPY global.json ./global.json
|
|
ARG AOTANYWHERE_VERSION=1.0.5
|
|
ARG ZIG_TOOLSET_VERSION=0.16.0.2
|
|
# Only SDK/tool versions affect this layer. Application versions and sources
|
|
# must not invalidate the expensive toolchain downloads on every pipeline.
|
|
RUN printf '%s\n' \
|
|
'<Project Sdk="Microsoft.NET.Sdk">' \
|
|
" <Sdk Name=\"StuDev.AotAnywhere\" Version=\"$AOTANYWHERE_VERSION\" />" \
|
|
' <PropertyGroup>' \
|
|
' <TargetFramework>net10.0</TargetFramework>' \
|
|
' <OutputType>Exe</OutputType>' \
|
|
' <PublishAot>true</PublishAot>' \
|
|
' <UseAotAnywhere>true</UseAotAnywhere>' \
|
|
' <NuGetAudit>false</NuGetAudit>' \
|
|
' </PropertyGroup>' \
|
|
' <ItemGroup>' \
|
|
" <PackageReference Include=\"Vezel.Zig.Toolsets.linux-x64\" Version=\"$ZIG_TOOLSET_VERSION\" GeneratePathProperty=\"true\" />" \
|
|
' </ItemGroup>' \
|
|
'</Project>' > Warmup.csproj \
|
|
&& dotnet restore Warmup.csproj -p:RuntimeFrameworkVersion=10.0.12 -p:PublishAot=true -p:UseAotAnywhere=true -r linux-musl-x64 \
|
|
&& dotnet restore Warmup.csproj -p:RuntimeFrameworkVersion=10.0.12 -p:PublishAot=true -p:UseAotAnywhere=true -r linux-musl-arm64 \
|
|
&& dotnet restore Warmup.csproj -p:RuntimeFrameworkVersion=10.0.12 -p:PublishAot=true -p:UseAotAnywhere=true -r linux-x64 \
|
|
&& dotnet restore Warmup.csproj -p:RuntimeFrameworkVersion=10.0.12 -p:PublishAot=true -p:UseAotAnywhere=true -r linux-arm64 \
|
|
&& rm Warmup.csproj \
|
|
&& rm -rf bin obj
|
|
|
|
WORKDIR /src/backend
|