Skip to content

uridium/docker-sonar-scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Docker SonarScanner

Docker Hub Latest tag

SonarScanner container to use when there is no specific scanner for your build system.

Requirements

  • docker

Installation

To build the container:

docker build -t uridium/sonar-scanner .

To download the latest version from the registry:

docker pull uridium/sonar-scanner

To download a specific sonar-scanner version:

docker pull uridium/sonar-scanner:4.3.0.2102

To verify the content and structure of the container:

docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd)/tests.yml:/tests.yml gcr.io/gcp-runtimes/container-structure-test test -i uridium/sonar-scanner -c tests.yml

Use

To run analysis in the current directory:

docker run -u "$(id -u):$(id -g)" -v "$(pwd):/usr/src" uridium/sonar-scanner -Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.login=${SONAR_AUTH_TOKEN} -Dsonar.projectKey=${SONAR_PROJECT_KEY} -Dsonar.projectName=${SONAR_PROJECT_NAME}

You can pass any analysis parameter to the container using -D