Public Repository

Last pushed: 3 years ago
Short Description
A configurable container for running sonarqube
Full Description

SonarQube Configurable Docker Container


This docker container runs
SonarQube and allows for linking a
SQL database container (MySQL, PostgreSQL, MSSQL, or Oracle).
You can also use an external SQL database or the embedded H2
database by setting the appropriate configuration variables.


  • Docker
  • Internet Access

Building The Container

git clone
cd sonarqube
git checkout <version>
docker build -t sonarqube ./

The version can be something like "5.1.2" or "4.5.5-LTS". To see a list, run "git tag"


By default, SonarQube supports PostgreSQL, Oracle, MSSQL, MySQL, and an
embedded H2 database. You should be able to use any database which
has a JDBC driver, but that would require customization of this container.
After running the container a single time with the H2 driver, the data
volume will be populated with the defaults and you could then add the JDBC
driver to <data>/sonar/extensions/jdbc-driver/<dbtype>/<jdbc driver jar file>.

For example, to enable Oracle as the database:

  • Pull/Build the container
  • Run the container using docker-compose and a data volume configured
  • Stop the container
  • Create a directory <data>/sonar/extensions/jdbc-driver/oracle
  • Copy the Oracle JDBC driver to that new directory
  • Update the docker-compose.yaml file to use the appropriate jdbc settings
  • Start the container using docker-compose

Quick Start

  • Install docker-compose
  • Download the docker-compose.yml file and save it as docker-compose.yml
  • Edit the docker-compose.yml file to meet your environment's needs
  • Start the container by running
    docker-compose up -d


In most cases, upgrading from one version of this container to the next consists of:

  • Stop the container
  • Delete <DATA_DIR>/data/es directory
  • Pull the new version of the container
  • Start the new container
  • Browse to http(s)://yourserver/upgrade
  • Follow upgrade instructions

You may need to adjust the URL above depending on your configuration. Also, upgrading plugins may be required.

Restarting the SonarQube Service

In order to install/upgrade plugins you need to restart the SonarQube service. You can do so
without having to restart the container if desired. Use the docker exec command as follows:

docker exec -it sonarqube_sonarqube_1 /usr/bin/restart

Configuration Environment Variables

See the README

Docker Pull Command