
A docker container to run sonarqube scanner
Just clone the repo with the usual : git clone https://github.com/airdock-io/docker-sonarqube-scanner.git
make build to build the image locallymake helpThen you will need the file sonar-scanner.properties filled with your properties important: you have to fill the file and complete it with the informations corresponding to languages and test reports For instance: if you have a php project you could add those 2 lines:
sonar.php.tests.reportPath=path/to/your/.sonar.test.xml
sonar.php.coverage.reportPaths=path/to/your/.sonar.coverage.xml
See https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/ for more informations on configration
Then to use the image locally: docker run --rm -v ${PWD}/sonar-scanner.properties:/var/sonar-scanner/conf/sonar-scanner.properties -v path/to/your/code:/var/app sonarqube-scanner:latest
Or to use the image form docker hub: docker run --rm -v ${PWD}/sonar-scanner.properties:/var/sonar-scanner/conf/sonar-scanner.properties -v path/to/your/code:/var/app airdock/sonarqube-scanner:latest
Some of these vars are defined in the Dockerfile and others are not. Vars used by the entrypoint and command should be defined in dockerfile, vars relative to the phrasea php app are defined (if not in compose environment section) in entrypoint with a default value.
| Var | Default Value |
|---|---|
| SONAR_SCANNER_VERSION | 4.3.0.2102 |
| JAVA_HOME | /usr |
| SONAR_SCANNER_OPTS | trustStore and trustStorePassword |
When using sonarqube over HTTPS you may need to add your certs to TrustStore. In order to do so jsut mount your certs in the folder /docker-entrypoint-certs.d, they will be injected during the entrypoint execution.
Content type
Image
Digest
Size
71.1 MB
Last updated
over 6 years ago
docker pull airdock/sonarqube-scanner