Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

wkulhanek/docker-openshift-sonarqube

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SonarQube on OpenShift

It is inspired by the upstream SonarQube Docker image: https://github.com/SonarSource/docker-sonarqube/tree/master/5.5

Quick usage

You can do something like the following, assuming you are in an existing OpenShift project:

oc new-app postgresql-persistent \
--param POSTGRESQL_USER=sonar --param POSTGRESQL_PASSWORD=sonar --param POSTGRESQL_DATABASE=sonar --param VOLUME_CAPACITY=4Gi -lapp=sonarqube_db

oc new-app docker.io/wkulhanek/sonarqube:latest \
-e SONARQUBE_JDBC_USERNAME=sonar -e SONARQUBE_JDBC_PASSWORD=sonar -e SONARQUBE_JDBC_URL=jdbc:postgresql:https://postgresql/sonar

oc expose service sonarqube --port=9000

echo "apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: sonarqube-pvc
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 4Gi" | oc create -f -
oc set volume dc/sonarqube --add --overwrite --name=sonarqube-volume-1 --mount-path=/opt/sonarqube/data/ --type persistentVolumeClaim --claim-name=sonarqube-pvc

This will result in your OpenShift environment deploying the included PostgreSQL database with persistent storage and then deploying the SonarQube image directly from DockerHub. It will also set up a PersistentVolumeClaim for SonarQube to store plugins and other data.

Probes

You should create Readiness and Liveness Probes for OpenShift to monitor the health of the SonarQube pod:

oc set probe dc/sonarqube --liveness --failure-threshold 3 --initial-delay-seconds 40 -- echo ok
oc set probe dc/sonarqube --readiness --failure-threshold 3 --initial-delay-seconds 20 --get-url=http:https://:9000/about

ToDos

  • Write an OpenShift template

About

An OpenShift-focused Docker build of Sonarqube

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 81.3%
  • Dockerfile 18.7%