adop-sonar is a wrapper for the sonarqube image. It has primarily been built to perform extended configuration. SonarQube® software (previously called Sonar) is an open source quality management platform, dedicated to continuously analyze and measure technical quality, from project portfolio to method.
To start the server with the default H2 database run the following, where VERSION is the release version of the Docker container.
docker run -d --name sonarqube -p 9000:9000 -e ADOP_LDAP_ENABLED=false adop/sonar:VERSION
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
.
docker run -d --name sonarqube \
-p 9000:9000 -p 9092:9092 \
-e SONARQUBE_JDBC_USERNAME=sonar \
-e SONARQUBE_JDBC_PASSWORD=sonar \
-e SONARQUBE_JDBC_URL="jdbc:mysql://sonar-mysql.service.adop.consul:3306/sonar?useUnicode=true&characterEncoding=utf8" \
adop/sonar:VERSION
A standard MySQL database can be started with the following.
docker run -td -p 3306:3306 -v /data/sonar:/var/lib/mysql \
-e MYSQL_USERNAME=sonar \
-e MYSQL_PASSWORD=sonar \
-e MYSQL_DATABASE=sonar \
-e MYSQL_ROOT_PASSWORD=sonar mysql:5.7
By default, the image will enable LDAP authentication, setting the ADOP_LDAP_ENABLED
environment variable to false will disable LDAP authentication.
The image reads the following LDAP environment variables:
LDAP_BIND_DN
} - the ldap root user bindnLDAP_BIND_PASSWORD
} - LDAP user roo user passwordLDAP_USER_BASE_DN
} - user basednLDAP_USER_REQUEST
} - user queryLDAP_USER_REAL_NAME_ATTRIBUTE
} - user's real name attribute e.g. displayNameLDAP_USER_EMAIL_ATTRIBUTE
} - user's email attribute, e.g. mailLDAP_GROUP_BASE_DN
} - group basednLDAP_GROUP_REQUEST
} - group queryLDAP_GROUP_ID_ATTRIBUTE
} - user group id attribute, e.g. cnBy default, the image will disable SSO authentication, setting the SSO_ENABLED
environment variable to True
will enable SSO authentication.
This images read the following SSO environment variables:
SSO_LOGIN_HEADER
- Name of the header to get the user login. Only alphanumeric, '.' and '@' characters are allowed.SSO_NAME_HEADER
- Name of the header to get the user name.SSO_EMAIL_HEADER
- Name of the header to get the user email (optional).SSO_GROUP_HEADER
- Name of the header to get the list of user groups, separated by comma (optional).SSO_REFRESH_INTERVAL
- Interval used to know when to refresh name, email and groups (optional).SONARQUBE_WEB_CONTEXT
- sonar web context e.g. /sonarSONARQUBE_SERVER_BASE
- sonar base e.g. http//domain.com/sonarSONARQUBE_JMX_ENABLED
- Enable JMX. Allowed values are true or false. Default : false
SONARQUBE_JMX_AUTH
- Enable Authentication on JMX Connections when JMX is enabled. Allowed values are true or false. Default : false
SONARQUBE_JMX_HOST
- Hostname or IP address of the host to which JMX clients connect. Default : localhost
SONARQUBE_JMX_PORT
- JMX Port. Default : 10433
SONARQUBE_JMX_USER
- Set username when authentication for JMX is enabled. Default: admin
SONARQUBE_JMX_USER_PASSWORD
- Set password for JMX user. Default: adminpassword
Please view licence information for the software contained on this image.
This image is officially supported on Docker version 1.9.1. Support for older versions (down to 1.6) is provided on a best-effort basis.
Documentation for this image is available in the Sonar documentation page.
Additional documentaion can be found under the docker-library/docs
GitHub repo. Be sure to familiarize yourself with the repository's README.md
file before attempting a pull request.
If you have any problems with or questions about this image, please contact us through a GitHub issue.
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
Before you start to code, we recommend discussing your plans through a GitHub issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.