1
votes

Using Docker-compose, created jenkins container and sonarQube container.

Docker-compose.yml:

jenkins:
  build: .
  ports:
   - "8080:8080"
  links:
   - sonarqube
postgresql:
  image: orchardup/postgresql:latest
  environment:
    - POSTGRESQL_USER=sonar
    - POSTGRESQL_PASS=xaexohquaetiesoo
    - POSTGRESQL_DB=sonar
sonarqube:
  image: harbur/sonarqube:5.0
  links:
    - postgresql:db
  environment:
    - DB_USER=sonar
    - DB_PASS=xaexohquaetiesoo
    - DB_NAME=sonar
    - VIRTUAL_HOST
    - VIRTUAL_PORT=9000
  ports:
    - "9000:9000"
    - "443:443"

Both the Container is up and running. Now i need to configure sonar runner in Jenkins Container.

My Question :is sonar runnner,sonar also installed inside the sonarqube container and how to configure in Jenkins?

1

1 Answers

0
votes

It can be done. Manage jenkins->SonarQube Scanner installations->Add installer->sonarqube runner jenkins configuration select required version of sonarqube runner. and follow the configurations.

When you use "build inside docker container", It will install sonar-runner with given version in jenkins global configurations.the sonar-runner.properties file used for the analysis will be same as that of sonarqube server configurations in Jenkins.