source https://gist.github.com/Swiss-Mac-User/8cc5a5e688f1b22d2c17b865649201d8#file-c_sonarqube-setup-md
docker pull sonarqube
docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:latest
mkdir ~/Downloads/sonarqube-armgit clone https://github.com/SonarSource/docker-sonarqube ~/Downloads/sonarqube-arm/docker build -t sonarqube-arm ~/Downloads/sonarqube-arm/docker-sonarqube/9/community
docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube-arm:latest
- User:
admin - Pass:
admin…and as instructed, set a new password.
On the SonarQube Dashboard…
- Click on «Create a project manually»
- Fill-in a project name and project key
- NOTE: you will need this project key later!
- Click on «Analyze your project locally»
- Fill-in a Token name
- NOTE: copy the generated Token, you will need this later!
- Click on «Other (for JS, TS, Go, Python, PHP, ...)» and select your OS preferences
- Follow the on-screen instructions
- Go to the intended project directory
- Create a new file named
sonar-project.properties - Add and modify the following contents to the sonar-project file:
# must be unique in a given SonarQube instance
sonar.projectKey=my_project_key_as_defined_on_sonarqube_web
# --- 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=.
#sonar.sources=src
# path to test source directories (optional)
#sonar.tests=tests
# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8
HINT: You can copy this command from the last step in the SonarQube project setup!
sonar-scanner \
-Dsonar.projectKey=my_project_key_as_defined_on_sonarqube_web \
-Dsonar.sources=. \
-Dsonar.host.url=http://localhost:9000 \
-Dsonar.login=my_sonarqube_project_token
…or using a simplified command, which reads other settings from the sonar-project file:
sonar-scanner -Dsonar.login=my_sonarqube_project_token