From ba3521d992d6546a5d08737d54112966e5df3e33 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Mon, 20 Nov 2023 17:01:03 -0800 Subject: [PATCH] Fix the Github release action on Windows (#14707) --- Dockerfile | 7 ++++++- Dockerfile-CI | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0c1f69e2ce3..d0ac1442191 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +FROM --platform=$TARGETOS golang:alpine AS build + FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env LABEL stage=build-env WORKDIR /app @@ -7,7 +9,10 @@ COPY ./src /app RUN dotnet publish /app/OrchardCore.Cms.Web -c Release -o ./build/release --framework net8.0 # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:8.0-nanoserver-1809 AS build_windows +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS build_linux +FROM build_${TARGETOS} AS aspnet + EXPOSE 80 ENV ASPNETCORE_URLS http://+:80 WORKDIR /app diff --git a/Dockerfile-CI b/Dockerfile-CI index 1a019b53864..eb8ce347a9d 100644 --- a/Dockerfile-CI +++ b/Dockerfile-CI @@ -1,7 +1,11 @@ # This Docker file is intended for the CI # A prerequisite is a published application in the .build/release -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM --platform=$TARGETOS golang:alpine AS build + +FROM mcr.microsoft.com/dotnet/aspnet:8.0-nanoserver-1809 AS build_windows +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS build_linux +FROM build_${TARGETOS} AS aspnet EXPOSE 80 ENV ASPNETCORE_URLS http://+:80