Docker images with out-of-the-box SonarQube 9.4.0, SonarQube 8.9 LTS, SonarQube 7.9 LTS and SonarQube 6.7 LTS instance with support for Scala, Scoverage (code coverage metrics) and Scalastyle + Scapegoat (static code analysis).
There are two types of images available: images with
sonar-scala plugin, which can be mounted
as a volume into a SonarQube container and images which bundle sonar-scala
plugin with SonarQube server (suffixed with -full
).
Starting from version 2.7.0
, the images no longer contain the
sonar-scala-extra plugin as
sonar-scala provides Scapegoat support from version 6.5.0
onwards.
6.0.0
,latest
Dockerfile,6.0.0-full
,latest-full
Dockerfile, Release 6.0.05.8.0
,latest-lts
(8.9 LTS) Dockerfile,5.8.0-full
,latest-lts-full
(8.9 LTS) Dockerfile, Release 5.8.04.2.0
,latest-lts
(7.9 LTS) Dockerfile,4.2.0-full
,latest-lts-full
(7.9 LTS) Dockerfile, Release 4.2.02.12.0
(6.7 LTS) Dockerfile,2.12.0-full
(6.7 LTS) Dockerfile, Release 2.12.0
For older versions please check the releases page on Github.
Version | SonarQube | sonar-scala |
---|---|---|
6.0.0 | 9.0.0 | |
6.0.0-full | 9.4.0 | 9.0.0 |
5.8.0 | 8.9.0 | |
5.8.0-full | 8.9.4 LTS | 8.9.0 |
4.2.0 | 7.9.0 | |
4.2.0-full | 7.9.1 LTS | 7.9.0 |
2.12.0 | 6.8.0 | |
2.12.0-full | 6.7.7 LTS | 6.8.0 |
To use one of the volume images, mount it as a volume to your existing SonarQube
container using e.g. docker-compose
:
version: "2"
services:
sonarqube:
image: sonarqube:9.4.0-community
ports:
- "80:9000"
networks:
- sonarnet
volumes_from:
- plugins
plugins:
image: mwizner/sonarqube-scala-plugins:6.0.0
volumes:
- sonarqube_plugins:/opt/sonarqube/extensions/plugins
command: /bin/true
networks:
sonarnet:
driver: bridge
volumes:
sonarqube_plugins:
You can find the full recipe here and here (for the LTS version).
To use the full
image, run the following docker
command:
docker run -d \
--name sonarqube-scala-plugins-full \
-p 80:9000 \
-e SONARQUBE_JDBC_USERNAME=sonar \
-e SONARQUBE_JDBC_PASSWORD=sonar \
-e SONARQUBE_JDBC_URL=jdbc:postgresql://localhost/sonar \
mwizner/sonarqube-scala-plugins:6.0.0-full
Please note that if you don't specify the SONARQUBE_JDBC_URL
variable,
SonarQube will use an embedded H2 database, which is not recommended in
production, but if you don't have access to an existing database or you just
want to try the image, you can use the following command:
docker run -d \
--name sonarqube-scala-plugins-full \
-p 80:9000 \
mwizner/sonarqube-scala-plugins:6.0.0-full
This project is open-sourced and can be found on Github.
sonar-scala documentation can be found on sonar-scala.com.