[docker] Update Dockerfile

Since https://github.com/dotnet/sdk/issues/32327 is resolved in net90, we no longer need to build with ubuntu.
This commit is contained in:
Laura Hausmann 2024-06-19 14:23:49 +02:00
parent ee7d4d1477
commit 946062a0ae
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -1,17 +1,12 @@
# syntax=docker/dockerfile-upstream:master # syntax=docker/dockerfile-upstream:master
# To build with AOT enabled, run docker build --build-arg="AOT=true" # To build with ILLink & AOT enabled, run docker build --build-arg="AOT=true"
# To build without VIPS support, run docker build --build-arg="VIPS=false" # To build without VIPS support, run docker build --build-arg="VIPS=false"
# We have to build AOT images on linux-glibc, at least until .NET 9.0 (See https://github.com/dotnet/sdk/issues/32327 for details)
ARG AOT=false ARG AOT=false
ARG IMAGE=${AOT/true/wasm} ARG IMAGE=${AOT/true/alpine-wasm}
ARG IMAGE=${IMAGE/false/alpine} ARG IMAGE=${IMAGE/false/alpine}
ARG RUNNER=${AOT/true/noble-chiseled}
ARG RUNNER=${RUNNER/false/alpine}
FROM --platform=$BUILDPLATFORM iceshrimp.dev/iceshrimp/dotnet-sdk:8.0-$IMAGE AS builder FROM --platform=$BUILDPLATFORM iceshrimp.dev/iceshrimp/dotnet-sdk:8.0-$IMAGE AS builder
WORKDIR /src WORKDIR /src
ARG BUILDPLATFORM ARG BUILDPLATFORM
@ -60,7 +55,7 @@ RUN --mount=type=cache,target=/root/.nuget \
# Enable globalization and time zones: # Enable globalization and time zones:
# https://github.com/dotnet/dotnet-docker/blob/main/samples/enable-globalization.md # https://github.com/dotnet/dotnet-docker/blob/main/samples/enable-globalization.md
# final stage/image # final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:8.0-$RUNNER-composite AS image FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine-composite AS image
WORKDIR /app WORKDIR /app
COPY --from=builder /app . COPY --from=builder /app .
USER app USER app