From a336b84366de2d719ecab6c66b99b314c067d4f0 Mon Sep 17 00:00:00 2001 From: irongut Date: Fri, 23 Apr 2021 22:53:16 +0100 Subject: [PATCH] simplified Dockerfile --- Dockerfile | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index f8b6229..cd660b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,11 @@ -FROM mcr.microsoft.com/dotnet/runtime:5.0 AS base -WORKDIR /app - FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build WORKDIR /src COPY ["src/CodeCoverageSummary/CodeCoverageSummary.csproj", "CodeCoverageSummary/"] RUN dotnet restore CodeCoverageSummary/CodeCoverageSummary.csproj -COPY ["src/", "CodeCoverageSummary/"] -RUN dotnet build CodeCoverageSummary/CodeCoverageSummary.csproj -c Release -o /app/build - -FROM build AS publish -RUN dotnet publish CodeCoverageSummary/CodeCoverageSummary.csproj -c Release -o /app/publish +COPY ["src/CodeCoverageSummary", "CodeCoverageSummary/"] +COPY ["src/coverage.cobertura.xml", "sample.coverage.xml"] +RUN dotnet build CodeCoverageSummary/CodeCoverageSummary.csproj --configuration Release --no-restore --output /app/build +RUN dotnet publish CodeCoverageSummary/CodeCoverageSummary.csproj --configuration Release --no-restore --output /app/publish # Label the container LABEL maintainer="Irongut " @@ -22,7 +18,8 @@ LABEL com.github.actions.description="A GitHub Action that reads Cobertura forma LABEL com.github.actions.icon="book-open" LABEL com.github.actions.color="purple" -FROM base AS final +FROM mcr.microsoft.com/dotnet/runtime:5.0 AS final WORKDIR /app -COPY --from=publish /app/publish . +COPY --from=build /app/publish . +COPY --from=build src/CodeCoverageSummary/sample.coverage.xml . ENTRYPOINT ["dotnet", "CodeCoverageSummary.dll"] \ No newline at end of file