Created
September 20, 2018 15:50
-
-
Save YhorbyMatias/a875150805c2c2a3515821a553766a7a to your computer and use it in GitHub Desktop.
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 microsoft/aspnetcore-build:2.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 microsoft/aspnetcore:2.0 | |
WORKDIR /app | |
COPY --from=build-env /app/out . | |
ENTRYPOINT ["dotnet", "HelloWorld.dll"] |
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 microsoft/aspnetcore-build:2.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 microsoft/aspnetcore:2.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