fix(infra): remove PublishReadyToRun and PublishTrimmed for Docker compatibility

- Remove -p:PublishReadyToRun=true (conflicts with --runtime)
- Remove -p:PublishTrimmed=true (simplify for Docker)
- Keep --runtime linux-x64 for Linux container builds

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Lasse Rune Hansen 2026-06-05 12:40:33 +02:00
parent 81f08f9f3b
commit 27dfb55da4

View file

@ -9,22 +9,21 @@
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src WORKDIR /src
# Copy project file and restore dependencies for Linux # Copy project file and restore dependencies
COPY ["GermanApp.csproj", "."] COPY ["GermanApp.csproj", "."]
RUN dotnet restore "GermanApp.csproj" --runtime linux-x64 RUN dotnet restore "GermanApp.csproj"
# Copy everything else and build # Copy everything else and build
COPY . . COPY . .
WORKDIR "/src" WORKDIR "/src"
RUN dotnet build "GermanApp.csproj" -c Release --runtime linux-x64 -o /app/build RUN dotnet build "GermanApp.csproj" -c Release -o /app/build
# Publish the application for Linux # Publish the application
RUN dotnet publish "GermanApp.csproj" -c Release -o /app/publish \ RUN dotnet publish "GermanApp.csproj" -c Release -o /app/publish \
--no-restore \ --no-restore \
--runtime linux-x64 \ --runtime linux-x64 \
-p:PublishReadyToRun=true \
-p:PublishSingleFile=false \ -p:PublishSingleFile=false \
-p:PublishTrimmed=true -p:PublishTrimmed=false
# ============================================ # ============================================
# Publish Stage # Publish Stage