Skip to content

Instantly share code, notes, and snippets.

@tonysneed
Created July 4, 2020 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonysneed/3b41060a9eb912e1a3537b53a55a7e82 to your computer and use it in GitHub Desktop.
Save tonysneed/3b41060a9eb912e1a3537b53a55a7e82 to your computer and use it in GitHub Desktop.
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-nanoserver-1909 AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-nanoserver-1909 AS build
WORKDIR /src
COPY ["MyWpfConsoleApp.csproj", "./"]
RUN dotnet restore "./MyWpfConsoleApp.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "MyWpfConsoleApp.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "MyWpfConsoleApp.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "MyWpfConsoleApp.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment