Public Repository

Last pushed: a year ago
Short Description
default sonarqube alpine image with some plugins preinstalled
Full Description

same as: docker pull sonarqube:6.1-alpine
plus plugins for

  • Android
  • C#
  • CSS
  • Clover
  • Developer Cockpit
  • Generic Coverage
  • Github Authentication
  • Git
  • Github
  • JSON
  • Java
  • JavaScript
  • PHP
  • PMD
  • SVN
  • WEB
  • XML

more documentation in the original sonarqube repo

How to use this image

Run Sonarqube

$ docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 rolafia/sonarqube-php

Now you have a running Sonarqube and you can access it by going to localhost:9000

  • user: admin
  • pass: admin

Run your local php code against sonarqube

create a local file in your php project called: sonar-project.properties

Contents:

sonar.projectKey=[groupName]:[projectName]
sonar.projectName=[projectNameLong]
sonar.projectVersion=[version]
sonar.sources=[sourceFolder]
sonar.sourceEncoding=[encoding]

for example:

sonar.projectKey=test:project1
sonar.projectName=Project #1
sonar.projectVersion=1.0
sonar.sources=src
sonar.sourceEncoding=UTF-8

Now run the Sonarqube runner:

more information in the original sonarqube runner repo

docker run --link sonarqube:sonarqube \
  --entrypoint /opt/sonar-runner-2.4/bin/sonar-runner \
  -e SONAR_USER_HOME=/data/.sonar-cache \
  -v `pwd`:/data -u `id -u` sebp/sonar-runner \
    -Dsonar.host.url=http://sonarqube:9000 \
    -Dsonar.jdbc.url=jdbc:h2:tcp://sonarqube/sonar \
    -Dsonar.jdbc.username=sonar \
    -Dsonar.jdbc.password=sonar \
    -Dsonar.jdbc.driverClassName=org.h2.Driver \
    -Dsonar.embeddedDatabase.port=9092

or

docker run --entrypoint /opt/sonar-runner-2.4/bin/sonar-runner \
  -e SONAR_USER_HOME=/data/.sonar-cache \
  -v `pwd`:/data -u `id -u` sebp/sonar-runner \
    -Dsonar.host.url=http://172.28.128.21:9000 \
    -Dsonar.jdbc.url=jdbc:h2:tcp://172.28.128.21/sonar \
    -Dsonar.jdbc.username=sonar \
    -Dsonar.jdbc.password=sonar \
    -Dsonar.jdbc.driverClassName=org.h2.Driver \
    -Dsonar.embeddedDatabase.port=9092

Check Results in Sonarqube

Go to: http://localhost:9000/dashboard/index

Docker Pull Command
Owner
rolafia