diff --git a/Dockerfile b/Dockerfile index f08a3e9..8b0a1d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ -FROM mcr.microsoft.com/dotnet/core/sdk:3.1.404 +FROM mcr.microsoft.com/dotnet/sdk:5.0.101 # Dockerfile meta-information LABEL maintainer="NOS Inovação S.A." \ - app_name="dotnet-sonar" + app_name="dotnet-sonar-50" ENV SONAR_SCANNER_MSBUILD_VERSION=5.0.4.24009 \ - DOTNETCORE_SDK=3.1.404 \ - DOTNETCORE_RUNTIME=3.1.10 \ - NETCOREAPP_VERSION=netcoreapp3.0 \ + DOTNETCORE_SDK=5.0.101 \ + DOTNETCORE_RUNTIME=5.0.1 \ + NETAPP_VERSION=net5.0 \ DOCKER_VERSION=5:19.03.13~3-0~debian-buster \ CONTAINERD_VERSION=1.3.7-1 \ OPENJDK_VERSION=11 \ @@ -48,9 +48,9 @@ RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \ # Install Sonar Scanner RUN apt-get install -y unzip \ - && wget https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/$SONAR_SCANNER_MSBUILD_VERSION/sonar-scanner-msbuild-$SONAR_SCANNER_MSBUILD_VERSION-$NETCOREAPP_VERSION.zip \ - && unzip sonar-scanner-msbuild-$SONAR_SCANNER_MSBUILD_VERSION-$NETCOREAPP_VERSION.zip -d /sonar-scanner \ - && rm sonar-scanner-msbuild-$SONAR_SCANNER_MSBUILD_VERSION-$NETCOREAPP_VERSION.zip \ + && wget https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/$SONAR_SCANNER_MSBUILD_VERSION/sonar-scanner-msbuild-$SONAR_SCANNER_MSBUILD_VERSION-$NETAPP_VERSION.zip \ + && unzip sonar-scanner-msbuild-$SONAR_SCANNER_MSBUILD_VERSION-$NETAPP_VERSION.zip -d /sonar-scanner \ + && rm sonar-scanner-msbuild-$SONAR_SCANNER_MSBUILD_VERSION-$NETAPP_VERSION.zip \ && chmod +x -R /sonar-scanner # Cleanup diff --git a/README.md b/README.md index 0f5c523..2ac531c 100644 --- a/README.md +++ b/README.md @@ -15,23 +15,28 @@ It also allows you to run Docker in Docker using a docker.sock mount. This latest image was built with the following components: -* dotnetcore-sdk-3.1.403 -* dotnetcore-runtime-3.1.9 (required by Sonar Scanner) -* SonarQube MSBuild Scanner 4.10.0 -* OpenJDK Java Runtime 11 (required by Sonar Scanner) +* dotnetcore-sdk-5.0.101 +* dotnetcore-runtime-5.0.1 (required by Sonar-Scanner) +* SonarQube MSBuild Scanner 5.0.4.24009 * Docker binaries 19.03.x (for running Docker in Docker using the docker.sock mount) - +* OpenJDK Java Runtime 11 (required by Sonar-Scanner) +* NodeJS 15 (required by Sonar-Scanner web analysis plugins) ## Supported tags and respective `Dockerfile` links > Tags are written using the following pattern: `dotnet-sonar:..` +* `20.12.2`, `latest` [(20.12.2/Dockerfile)](https://github.com/nosinovacao/dotnet-sonar/blob/20.12.2/Dockerfile) + * DotNet 5.0.101 + * SonarScanner 5.0.4.24009 +* `20.12.1` [(20.12.1/Dockerfile)](https://github.com/nosinovacao/dotnet-sonar/blob/20.12.1/Dockerfile) + * DotNetCore 3.1.404 + * SonarScanner 5.0.4.24009 +* `20.12.0` [(20.12.0/Dockerfile)](https://github.com/nosinovacao/dotnet-sonar/blob/20.12.0/Dockerfile) + * DotNetCore 2.2.402 + * SonarScanner 5.0.4.24009 * `20.10.1`, `latest` [(20.10.1/Dockerfile)](https://github.com/nosinovacao/dotnet-sonar/blob/20.10.1/Dockerfile) - * DotNetCore 3.1.403 - * SonarScanner 4.10.0.19059 * `20.10.0` [(20.10.0/Dockerfile)](https://github.com/nosinovacao/dotnet-sonar/blob/20.10.0/Dockerfile) - * DotNetCore 2.2.207 - * SonarScanner 4.10.0.19059 * `20.07.0` [(20.07.0/Dockerfile)](https://github.com/nosinovacao/dotnet-sonar/blob/20.07.0/Dockerfile) * `19.12.0` [(19.12.0/Dockerfile)](https://github.com/nosinovacao/dotnet-sonar/blob/19.12.0/Dockerfile) * `19.10.1` [(19.10.1/Dockerfile)](https://github.com/nosinovacao/dotnet-sonar/blob/19.10.1/Dockerfile) @@ -89,22 +94,22 @@ Advance Usage: $ docker run -it --rm \ -v :/source \ -v :/nuget \ -$ dotnet-sonar:20.10.1 \ -$ bash -c \ - "cd source \ - && dotnet /sonar-scanner/SonarScanner.MSBuild.dll begin \ - /k: /name: /version: \ - /d:sonar.host.url="" \ - /d:sonar.login="" \ - /d:sonar.password="" \ - /d:sonar.cs.opencover.reportsPaths='tests/**/coverage.opencover.xml' \ - && dotnet restore --configfile /nuget/NuGet.Config \ - && dotnet build -c Release \ - && dotnet publish -c Release -r linux-x64 -o deployment \ - && dotnet test --no-build -c Release --filter "Category=Unit" --logger trx --results-directory testResults /p:CollectCoverage=true / p:CoverletOutputFormat=\"opencover\" \ - && dotnet /sonar-scanner/SonarScanner.MSBuild.dll end \ - /d:sonar.login="" \ - /d:sonar.password=""" + dotnet-sonar:latest \ + bash -c \ + "cd source \ + && dotnet /sonar-scanner/SonarScanner.MSBuild.dll begin \ + /k: /name: /version: \ + /d:sonar.host.url="" \ + /d:sonar.login="" \ + /d:sonar.password="" \ + /d:sonar.cs.opencover.reportsPaths='tests/**/coverage.opencover.xml' \ + && dotnet restore --configfile /nuget/NuGet.Config \ + && dotnet build -c Release \ + && dotnet publish -c Release -r linux-x64 -o deployment \ + && dotnet test --no-build -c Release --filter "Category=Unit" --logger trx --results-directory testResults /p:CollectCoverage=true / p:CoverletOutputFormat=\"opencover\" \ + && dotnet /sonar-scanner/SonarScanner.MSBuild.dll end \ + /d:sonar.login="" \ + /d:sonar.password=""" ``` The script above does the following: