Skip to content

Instantly share code, notes, and snippets.

@gusalbukrk
Last active August 13, 2023 02:52
Show Gist options
  • Save gusalbukrk/b00ac5d0cf19e141d24d7ff7196f642b to your computer and use it in GitHub Desktop.
Save gusalbukrk/b00ac5d0cf19e141d24d7ff7196f642b to your computer and use it in GitHub Desktop.
#sonarqube

SonarQube

Running SonarQube locally using Docker

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, password admin) 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment