Skip to content

A local Docker-based setup to run SonarQube for Hackathons etc.

License

Notifications You must be signed in to change notification settings

pasiorovuo/sonarqube-local

Repository files navigation

Running

A semi-simple way to run SonarQube locally for code analysis. Intended to be used at hackathons etc. after which the environment can be easily destroyed.

SonarQube server

# Adjust system limits to accommodate needs of Elastic
sysctl -w vm.max_map_count=524288
sysctl -w fs.file-max=131072
ulimit -n 131072
ulimit -u 8192

# Start SonarQube server
docker compose up -d

Database, logs etc. are preserved in their approproate subfolders under the installation.

Open up http://localhost:9000 and change the password for the admin user, as requested. Make note of the password as its needed to run the code analysis.

SonarQube scanner

# Build the SonarQube scanner container
bash build-sonarscanner-cli-docker.sh

# Run code analysis
docker run -it --rm --network sonarqube_default -v "${PATH_TO_PROJECT}:/usr/src" sonarscanner-cli:latest -Dsonar.host.url=http://sonarqube:9000 -Dsonar.login=admin -Dsonar.password="${SONARQUBE_PASSWORD}" -Dsonar.projectKey="${PROJECT_KEY}"

About

A local Docker-based setup to run SonarQube for Hackathons etc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages