Skip to content

Instantly share code, notes, and snippets.

@mafshin
Created March 31, 2019 08:28
Show Gist options
  • Save mafshin/1b3a441b6c8f57da4bd4dd185049bb42 to your computer and use it in GitHub Desktop.
Save mafshin/1b3a441b6c8f57da4bd4dd185049bb42 to your computer and use it in GitHub Desktop.
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-alpine as build
WORKDIR /app
COPY *.csproj .
RUN dotnet restore -r linux-musl-x64
FROM build as publish
WORKDIR /app
COPY . .
#add IL linker package
RUN dotnet add package ILLink.Tasks -v 0.1.5-preview-1841731 -s https://dotnet.myget.org/F/dotnet-core/api/v3/index.json
RUN dotnet publish -c Release -r linux-musl-x64 -o out --no-restore /p:ShowLinkerSizeComparison=true
FROM mcr.microsoft.com/dotnet/core/runtime-deps:2.2-alpine as runtime
WORKDIR /app
EXPOSE 80
COPY --from=publish /app/out ./
ENTRYPOINT ["./demoapp"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment