SonarScanner container to use when there is no specific scanner for your build system.
- docker
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
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