fix(infra): add linux-x64 runtime identifier for Docker build
- Add --runtime linux-x64 to dotnet restore - Add --runtime linux-x64 to dotnet build - Add --runtime linux-x64 to dotnet publish Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
01e6bf3f28
commit
81f08f9f3b
1 changed files with 5 additions and 4 deletions
|
|
@ -9,18 +9,19 @@
|
|||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# Copy project file and restore dependencies
|
||||
# Copy project file and restore dependencies for Linux
|
||||
COPY ["GermanApp.csproj", "."]
|
||||
RUN dotnet restore "GermanApp.csproj"
|
||||
RUN dotnet restore "GermanApp.csproj" --runtime linux-x64
|
||||
|
||||
# Copy everything else and build
|
||||
COPY . .
|
||||
WORKDIR "/src"
|
||||
RUN dotnet build "GermanApp.csproj" -c Release -o /app/build
|
||||
RUN dotnet build "GermanApp.csproj" -c Release --runtime linux-x64 -o /app/build
|
||||
|
||||
# Publish the application
|
||||
# Publish the application for Linux
|
||||
RUN dotnet publish "GermanApp.csproj" -c Release -o /app/publish \
|
||||
--no-restore \
|
||||
--runtime linux-x64 \
|
||||
-p:PublishReadyToRun=true \
|
||||
-p:PublishSingleFile=false \
|
||||
-p:PublishTrimmed=true
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue