Switch branches/tags
Nothing to show
Find file Copy path
f8e3253 Jul 16, 2018
1 contributor

Users who have contributed to this file

31 lines (24 sloc) 874 Bytes
FROM microsoft/dotnet:2.1-sdk-alpine AS build
# copy csproj and restore as distinct layers
COPY dotnetapp/*.csproj ./dotnetapp/
COPY utils/*.csproj ./utils/
WORKDIR /app/dotnetapp
RUN dotnet restore
# copy and build app and libraries
COPY dotnetapp/. ./dotnetapp/
COPY utils/. ./utils/
WORKDIR /app/dotnetapp
# add IL Linker package
RUN dotnet add package ILLink.Tasks -v 0.1.5-preview-1841731 -s
RUN dotnet publish -c Release -r linux-musl-x64 -o out /p:ShowLinkerSizeComparison=true
# test application -- see:
FROM build AS testrunner
WORKDIR /app/tests
COPY tests/. .
ENTRYPOINT ["dotnet", "test", "--logger:trx"]
FROM microsoft/dotnet:2.1-runtime-deps-alpine AS runtime
COPY --from=build /app/dotnetapp/out ./
ENTRYPOINT ["./dotnetapp"]