Skip to content

Instantly share code, notes, and snippets.

@gistlyn
Last active December 15, 2022 00:55
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 gistlyn/ed8043e696d985603db14eb66f7593e4 to your computer and use it in GitHub Desktop.
Save gistlyn/ed8043e696d985603db14eb66f7593e4 to your computer and use it in GitHub Desktop.
dotnet-build
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /app
COPY . .
RUN dotnet restore
WORKDIR /app/MyApp
RUN dotnet publish -c release -o /out --no-restore
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime
WORKDIR /app
COPY --from=build /out ./
ENTRYPOINT ["dotnet", "MyApp.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment