From 15a9b1699adc2212643263b145c75b1c2c54bd1b Mon Sep 17 00:00:00 2001 From: irongut Date: Thu, 15 Apr 2021 23:12:01 +0100 Subject: [PATCH] added docker support --- src/.dockerignore | 25 +++++++++++++++++++ .../CodeCoverageSummary.csproj | 2 ++ src/CodeCoverageSummary/Dockerfile | 20 +++++++++++++++ .../Properties/launchSettings.json | 11 ++++++++ 4 files changed, 58 insertions(+) create mode 100644 src/.dockerignore create mode 100644 src/CodeCoverageSummary/Dockerfile create mode 100644 src/CodeCoverageSummary/Properties/launchSettings.json diff --git a/src/.dockerignore b/src/.dockerignore new file mode 100644 index 0000000..bdca33b --- /dev/null +++ b/src/.dockerignore @@ -0,0 +1,25 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md \ No newline at end of file diff --git a/src/CodeCoverageSummary/CodeCoverageSummary.csproj b/src/CodeCoverageSummary/CodeCoverageSummary.csproj index a115c84..864cc45 100644 --- a/src/CodeCoverageSummary/CodeCoverageSummary.csproj +++ b/src/CodeCoverageSummary/CodeCoverageSummary.csproj @@ -3,10 +3,12 @@ Exe net5.0 + Linux + diff --git a/src/CodeCoverageSummary/Dockerfile b/src/CodeCoverageSummary/Dockerfile new file mode 100644 index 0000000..4801c1d --- /dev/null +++ b/src/CodeCoverageSummary/Dockerfile @@ -0,0 +1,20 @@ +#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. + +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 ["CodeCoverageSummary/CodeCoverageSummary.csproj", "CodeCoverageSummary/"] +RUN dotnet restore "CodeCoverageSummary/CodeCoverageSummary.csproj" +COPY . . +WORKDIR "/src/CodeCoverageSummary" +RUN dotnet build "CodeCoverageSummary.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "CodeCoverageSummary.csproj" -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "CodeCoverageSummary.dll"] \ No newline at end of file diff --git a/src/CodeCoverageSummary/Properties/launchSettings.json b/src/CodeCoverageSummary/Properties/launchSettings.json new file mode 100644 index 0000000..2fd0dee --- /dev/null +++ b/src/CodeCoverageSummary/Properties/launchSettings.json @@ -0,0 +1,11 @@ +{ + "profiles": { + "CodeCoverageSummary": { + "commandName": "Project" + }, + "Docker": { + "commandName": "Docker", + "commandLineArgs": "/src/coverage.cobertura.xml --format=md --badge=true" + } + } +} \ No newline at end of file