Created
March 6, 2022 16:36
-
-
Save A-Programmer/33bc333ae2dcddb1af409fe126d3294c to your computer and use it in GitHub Desktop.
NETCore 6.0 project Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env | |
WORKDIR /app | |
# Copy csproj and restore as distinct layers | |
COPY *.csproj ./ | |
RUN dotnet restore | |
# Copy everything else and build | |
COPY . ./ | |
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", "HelloWorld.dll"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment