Skip to content

Commit

Permalink
Set the DOTNET_EnableWriteXorExecute flag to fix issues with dotnet r…
Browse files Browse the repository at this point in the history
…estore.
  • Loading branch information
trilleplay authored May 2, 2024
1 parent b3010da commit b3dc6b7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Nexpo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["Nexpo/Nexpo.csproj", "Nexpo/"]
# Below is needed due to build issues that arrise when restoring on some types of hardware on .NET 7.0.
ENV DOTNET_EnableWriteXorExecute=0
RUN dotnet restore "Nexpo/Nexpo.csproj"
COPY . .
WORKDIR "/src/Nexpo"
Expand All @@ -18,4 +20,4 @@ RUN dotnet publish "Nexpo.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Nexpo.dll"]
ENTRYPOINT ["dotnet", "Nexpo.dll"]

0 comments on commit b3dc6b7

Please sign in to comment.