Skip to content

Instantly share code, notes, and snippets.

@kyawzaymoore
Created May 8, 2022 09:19
Show Gist options
  • Save kyawzaymoore/8d5101d8fbf9e087feba47564df1fdf9 to your computer and use it in GitHub Desktop.
Save kyawzaymoore/8d5101d8fbf9e087feba47564df1fdf9 to your computer and use it in GitHub Desktop.
dotnet docker file
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
WORKDIR /app
# Copy everything
COPY . ./
# Restore as distinct layers
RUN dotnet restore
# Build and publish a release
RUN dotnet publish -c Release -o out
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "fidotech.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment