MirrorNest
← Tüm kılavuzlar

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.

Hedef: Any Docker host (Linux)DevOpsSecurityResmi ana sayfa ↗Resmi belgeler ↗
Bu kılavuz, yukarıda bağlantısı verilen SonarQube kendi resmi belgelerinden derlenmiştir — dağıtım ve proje sürümleri zamanla değiştiğinden, bu komutları bir üretim sunucusunda çalıştırmadan önce tam paket/sürüm adlarını her zaman orada kontrol edin.
  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.