- Make sure your VM on Docker has at least 4gb of memory (Server and runner takes a lot of memory)
- this can be checked under docker preference > resources
docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:latest
- default user/pw is admin/admin
- this is found under Account (Icon from upper right) > Security > Generate Token ( you need this in running sonar scanner)
- Under your project that you want to scan, create
sonar-project.properties
, file name is crucial
# must be unique in a given SonarQube instance
sonar.projectKey=my:project
# --- optional properties ---
# defaults to project key
#sonar.projectName=My project
# defaults to 'not provided'
#sonar.projectVersion=1.0
# Path is relative to the sonar-project.properties file. Defaults to .
#sonar.sources=.
# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8
- Run Scanner: Remember to update token (from step 1) and source folder as the volume. After running it will appear in the dashboard
docker run \
--rm \
--network=host \
-e SONAR_HOST_URL="http://127.0.0.1:9000" \
-e SONAR_LOGIN="{SONAR_SECURITY_TOKEN}" \
-v "/Users/melchor_tatlonghari/workspace/${LOCAL_DIRECTORY}:/usr/src" \
sonarsource/sonar-scanner-cli
- Full standalone frontend: https://www.npmjs.com/package/notarealdb