Created
November 23, 2017 16:11
-
-
Save radu-matei/de63a6a0bdb28263f7a703947c22b905 to your computer and use it in GitHub Desktop.
dockerfile-alpine
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/dotnet-nightly:2.1-sdk AS build-env | |
WORKDIR /app | |
# copy csproj and restore as distinct layers | |
COPY *.csproj ./ | |
COPY NuGet.config ./ | |
RUN dotnet restore | |
# copy everything else and build | |
COPY . ./ | |
RUN dotnet publish -c Release -o out --no-restore | |
# build runtime image | |
FROM microsoft/dotnet-nightly:2.1-runtime-alpine | |
WORKDIR /app | |
COPY --from=build-env /app/out ./ | |
ENTRYPOINT ["dotnet", "dotnetapp.dll"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment