Sign inSign up

subnova/docker-dotnet-sonarscanner

By subnova

Updated over 8 years ago

Sonarqube scanner for dotnet core applications using latest dotnet SDK

Image
0

222

subnova/docker-dotnet-sonarscanner repository overview

.Net Core Sonar Scanner on Docker Container

Sonar Scanner MsBuild Dockerfile for .Net Core Projects

Cloned from https://hub.docker.com/r/burakince/docker-dotnet-sonarscanner/ but with latest dotnet SDK (2.1.4).

Using Example

First of all you need a sonarqube server. If you haven't one, run this code;

docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube

And then you need .Net Core project. If you haven't one, run this codes;

mkdir ConsoleApplication1
cd ConsoleApplication1

dotnet new console
dotnet new sln
dotnet sln ConsoleApplication1.sln add ConsoleApplication1.csproj

Take login token from sonarqube server, change working directory to project directory and run this code;

docker run --name dotnet-scanner -it --rm -v $(pwd):/project \
  -e PROJECT_KEY=ConsoleApplication1 \
  -e PROJECT_NAME=ConsoleApplication1 \
  -e PROJECT_VERSION=1.0 \
  -e HOST=http://localhost:9000 \
  -e LOGIN_KEY=CHANGE_THIS_ONE \
  subnova/docker-dotnet-sonarscanner

Note: If you have sonarqube as docker container, you must inspect sonarqube's bridge network IP address and use it in HOST variable.

docker network inspect bridge

Tag summary

Content type

Image

Digest

Size

511.5 MB

Last updated

over 8 years ago

docker pull subnova/docker-dotnet-sonarscanner