https://docs.sonarsource.com/sonarqube/latest/try-out-sonarqube/
$ docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:latest
- go to http://localhost:9000, log in (user:
admin
, passwordadmin
) and follow the instructions on how to analyze a project - to run the analysis on your project you'll need to execute a scanner, to execute SonarScanner from the Docker image run:
# https://docs.sonarsource.com/sonarqube/10.1/analyzing-source-code/scanners/sonarscanner/#sonarscanner-from-docker-image
docker run \
--network=host \
--rm \
-e SONAR_HOST_URL="http://localhost:9000" \
-e SONAR_SCANNER_OPTS="-Dsonar.projectKey=myprojectkey" \
-e SONAR_TOKEN="sqp_a4ef929427e10f6f3d023118ddf25d35f8f29097" \
-v "/var/www/working.com:/usr/src" \
sonarsource/sonar-scanner-cli