Skip to content

Instantly share code, notes, and snippets.

@radu-matei
Last active November 24, 2017 08:46
Show Gist options
  • Save radu-matei/938cd7cacb4b3239af320abad3625137 to your computer and use it in GitHub Desktop.
Save radu-matei/938cd7cacb4b3239af320abad3625137 to your computer and use it in GitHub Desktop.
FROM microsoft/dotnet-nightly:2.1-sdk AS build-env
WORKDIR /app
# copy csproj and restore as distinct layers
COPY nuget.config ./
COPY *.csproj ./
RUN dotnet restore
# copy everything else and build
COPY . ./
RUN dotnet publish -c Release -r linux-x64 -o out
# build runtime image
FROM microsoft/dotnet-nightly:2.1-runtime-deps-alpine
WORKDIR /app
COPY --from=build-env /app/out ./
ENTRYPOINT ["./dotnetapp"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment