The following guide, alldescribe how to run in a contaner the community version of SonarQube. Languages suported:
You need to install
- docker
- docker-compose
For Mac Osx
brew install docker
brew install docker-composedocker-compose upGo to https:l127.0.0.1:9000.
change the default credential (admin/admin) if asked to do. For instance you can use sonar as new password.
Now it is time to create a 'test' project. You can select add a project or new project to reach the following screen.
Select Manually and fill the next form as following
Click Set Up. and select to analyze the repository locally
Then click on Generate.
Finally keep note of the TOKEN (ie. sqp_4089e3b40374e096cd9dd7769fa31cf6b04fe1da
you will use in the next step.
In a new terminal, go to the source folder you want to scan
cd ${SOURCEPATH}Raplace the TOKEN witht he one generated at the previous setup step
docker run --rm --network="host" -v "$(pwd):/data" noenv/sonar-scanner sonar-scanner -D sonar.projectKey=test -D sonar.host.url=http://127.0.0.1:9000 -D sonar.login=TOKEN -D sonar.language=php -D sonar.sources=.Exmaple if the TOKEN is sqp_4089e3b40374e096cd9dd7769fa31cf6b04fe1da you need to run form the source folder the following
docker run --rm --network="host" -v "$(pwd):/data" noenv/sonar-scanner sonar-scanner -D sonar.projectKey=test -D sonar.host.url=http://127.0.0.1:9000 -D sonar.login=sqp_5737388298059550c4fc8a255f4208a734d468e9 -D sonar.language=php -D sonar.sources=.Execute it.








