brew install docker --cask
from /Applications/Docker.app
Wait until the "Docker Dashboard starting…"-message disappears (= Setup complete)
brew install sonar-scanner
Find the SonarScanner bin
-directory (can be taken from the homebrew package installation information)
/usr/local/Cellar/sonar-scanner/4.7.0.2747/libexec/bin
Edit the current User's bash source
nano ~/.zshrc
Add these line somewhere:
# === SonarQube ===
# NOTE: sonar-scanner Version in dir-path may change!
export PATH=/usr/local/Cellar/sonar-scanner/4.7.0.2747/libexec/bin:$PATH
Save and close.
docker pull sonarqube
docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:latest
mkdir ~/Downloads/sonarqube-arm
git 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
admin
admin
…and as instructed, set a new password.On the SonarQube Dashboard…
sonar-project.properties
# 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
E.g. to be used with same settings on another Mac.
docker stop sonarqube
docker commit sonarqube mysonarqube
Save the image file to any user accessible folder in macOS Finder e.g. to the «Downloads»-folder, using:
docker save mysonarqube -o ~/Downloads/SonarQube-DockerBackup.tar
docker save mysonarqube | gzip > ~/Downloads/SonarQube-DockerBackup.tar.gz
E.g. on the second Mac.
docker load < /path/to/SonarQube-DockerBackup.tar.gz
Loading layer [==================================================>] 337.9MB/337.9MB
Loaded image: mysonarqube:latest
NOTE: must use the image file reference, instead of sonarqube:latest
!
docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 mysonarqube:latest
http://localhost:9000/dashboard