Sign inSign up

militellovinx/sonarqube

By militellovinx

Updated almost 9 years ago

SonarQube 6.5 on Alpine with LDAP integration

Image
0

292

militellovinx/sonarqube repository overview

SonarQube 6.5 on Alpine with LDAP integration

logo

What is SonarQube?

SonarQube is an open source platform for continuous inspection of code quality.

Pre-installed plugins

The container will start with the following plugins already installed

PluginVersion
Flex2.3
LDAP2.2
SonarC#5.10.1
SonarJS3.1.1
SonarJava4.12.0.11033
SonarPHP1.8
SonarPython1.8
SCM / Git1.2
SCM / SVN1.5
SonarTS1.1
SonarXML1.4.3
Web2.5.0.476

Environment Variables

By default, the image will use an embedded H2 database that is not suited for production.

The production database is configured with these variables: SONARQUBE_JDBC_USERNAME, SONARQUBE_JDBC_PASSWORD and SONARQUBE_JDBC_URL.

VariableExplanationExampleDefault
JDBC_USERNAMEUsername for the internal database connectionmyusersonar
JDBC_PASSWORDPassword for the internal database connectionmypasswordsonar
SONARQUBE_JDBC_URLThe JDBC URL that was used to establish the current connection.jdbc:postgresql://localhost/sonarempty

In order to connect to an LDAP server, you need to provide the following environment variables

VariableExplanationExampleDefault
SONARQUBE_LDAP_ENABLEIf set to true the container will be configured to use LDAP authenticationfalse
SONARQUBE_BASE_DNBase DN used for LDAP authenticationdc=mycorp,dc=comempty
SONARQUBE_REALMLDAP domain REALMmycorp.comempty
SONARQUBE_LDAP_URLLDAP URLhttp://mycorp.com:389ldap://localhost:389
SONARQUBE_LDAP_BINDDNLDAP BindDn[email protected]administrator@SONARQUBE_REALM
SONARQUBE_LDAP_PASSWORDLDAP PasswordMyBaseDNPasswordempty

Please, note that if SONARQUBE_LDAP_ENABLE is to true,both SONARQUBE_LDAP_PASSWORD and SONARQUBE_BASE_DN must be initialized. In case they are not, the container will start without any LDAP configuration

Docker run

$ docker run -d --name sonarqube \
                -p 9000:9000 -p 9092:9092 \
                -e SONARQUBE_JDBC_USERNAME=sonar \
                -e SONARQUBE_JDBC_PASSWORD=sonar \
                -e SONARQUBE_LDAP_ENABLE=true \
                -e SONARQUBE_BASE_DN=dc=foo,dc=com \
                -e SONARQUBE_REALM=foo.com \
                -e SONARQUBE_LDAP_URL=ldap://fooserver:389 \
                -e [email protected] \
                -e SONARQUBE_LDAP_PASSWORD=P4ssW0rd1! \
                militellovinx/sonarqube:latest

Docker Compose Example

version: '3.3'

services:
  sonar-service:
    image: militellovinx/sonarqube:latest
    restart: "unless-stopped"
    ports:
      - 9000:9000
    environment:
      - SONARQUBE_JDBC_USERNAME=sonar
      - SONARQUBE_JDBC_PASSWORD=sonar
      - SONARQUBE_LDAP_ENABLE=true
      - SONARQUBE_BASE_DN=dc=foo,dc=com
      - SONARQUBE_REALM=foo.com
      - SONARQUBE_LDAP_URL=ldap://fooserver:389
      - [email protected]
      - SONARQUBE_LDAP_PASSWORD=P4ssW0rd1!

Useful resources

Tag summary

Content type

Image

Digest

Size

216.3 MB

Last updated

almost 9 years ago

docker pull militellovinx/sonarqube