MirrorNest
← Alle Anleitungen

SonarQube

SonarQube (now split into the free SonarQube Community Build and commercial SonarQube Server) is a static analysis platform that continuously inspects code quality, bugs, vulnerabilities, and code smells across dozens of languages.

Zielsystem: Any Docker host (Linux)DevOpsSecurityOffizielle Website ↗Offizielle Dokumentation ↗
Diese Anleitung basiert auf der offiziellen Dokumentation von SonarQube, oben verlinkt — überprüfe dort immer die genauen Paket-/Versionsnamen, bevor du diese Befehle auf einem Produktionsserver ausführst, da sich Distributions- und Projektversionen mit der Zeit ändern.
  1. 1Tune the host for embedded Elasticsearch

    SonarQube bundles Elasticsearch, which needs raised memory-map and file-descriptor limits on the Docker host itself.

    sudo sysctl -w vm.max_map_count=524288
    sudo sysctl -w fs.file-max=131072
    ulimit -n 131072
    ulimit -u 8192
  2. 2Run the container (evaluation)

    docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:community

    This uses the ephemeral built-in H2-less embedded database and is fine for evaluation only.

  3. 3Run with persistent volumes (recommended)

    docker run -d --name sonarqube -p 9000:9000 -v sonarqube_data:/opt/sonarqube/data -v sonarqube_extensions:/opt/sonarqube/extensions -v sonarqube_logs:/opt/sonarqube/logs sonarqube:community

    For real usage, also point SONAR_JDBC_URL / SONAR_JDBC_USERNAME / SONAR_JDBC_PASSWORD at an external PostgreSQL database rather than the embedded one.

  4. 4First login

    Browse to http://localhost:9000 once the container reports it's up.

    Default credentials are admin/admin; you'll be forced to change the password on first login.