Can the docker image of sonarqube use env for configuring any settings?

sonarqube docker
sonarqube environment variables
sonarqube docker-compose
sonarqube docker image with mysql
where is sonarqube data stored
sonarqube database
sonarqube installation
sonarqube sql server

I am trying to configure this image with LDAP.

In the documentation, they argue you can configure for jdbc with :

  • SONARQUBE_JDBC_USERNAME: sonar.jdbc.username*
  • SONARQUBE_JDBC_PASSWORD: sonar.jdbc.password*
  • SONARQUBE_JDBC_URL: sonar.jdbc.url*

I wonder how I could do the same for LDAP.

Is it possible to use any settings through their environment name ?

Eg: SONAR_LOG_LEVEL=DEBUG

Otherwise, there is inside the container a /opt/sonarqube/conf/sonar.properties is it there and how should I start editing ?

Another way of achieving what you want is by creating your own sonar.properties file and copying that into the container along with the wrapper.properties.

In the docker-compose.yml

volumes:
    - ./sonar-properties:/opt/sonarqube/conf

How to persist configuration & analytics across container invocations , We need to setup a database of our own and point it to Sonarqube at the time of starting the container. so that all the downloaded plugins are available across container invocations and can be used by multiple containers (if required) know the containers IP before hand, we use '%' for sonarqube host IP  How to use this image. SonarQube requires access to a PostgreSQL database to store information. We'll use our very own PostgreSQL image for the database requirements. Using Docker Compose Run the application using Docker Compose. The main folder of this repository contains a functional docker-compose.yml file. Run the application using it as

Otherwise, there is inside the container a /opt/sonarqube/conf/sonar.properties is it there and how should I start editing ?

No, generally what you want to do is possible adding information to your docker-compose file. In particular in your YML file under the key "enviroment" you can add whatever variable you want. Here an example of docker-compose.yml file:

version: "3"
services:
  registry:
    image: registry:2
    ports:
      - 0.0.0.0:5000:5000
    environment:
      REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data
      REGISTRY_STORAGE_DELETE_ENABLED: "true"
    volumes:
      - /data/reg:/var/lib/registry
    hostname: "myhost.registry"

Than use the compose file to deploy the stack with your custom enviroment.

Environment Variables, provides environment variables used for configuring SonarQube with Docker. By default, ports will be used on all IP addresses associated with the server. Set to true when connecting to a LDAP server using a case-insensitive setup. SonarQube is an open source platform for continuous inspection of code quality.

The solution I found it's to take the configuration file (sonar.properties), to parameter it and to place it in docker-compose.yml :

services:
  sonarqube:
    image: sonarqube
    ports:
      - "9000:9000"
    networks:
      - sonarnet
    environment:
      - sonar.jdbc.url=
    volumes:
      - sonarqube_conf:/opt/sonarqube/conf
      - sonarqube_data:/opt/sonarqube/data
      - sonarqube_extensions:/opt/sonarqube/extensions
      - ./sonar.properties:/opt/sonarqube/conf/sonar.properties

With that, the config file localy is placed in docker.

I hope it's help you

How to change SonarQube port - Xin Zhang, like Oracle, MySQL …. and it is used to store the analysis results that can be displayed using the UI of the tool. Is there a way to configure things like LDAP in "sonar.properties" like with environment variables? No. Right now is not possible to do it. I think you could just start the container with the default configuration, exec into the container, edit the configuration and restart the sonarqube service with this command: nami restart sonarqube

What is the role of database in SonarQube?, When you are ready to move to a more sustainable setup, take some time to By default, the image will use an embedded H2 database that is not suited for production. Create a sonarqube_home folder and create a environment variable  Use this connection string if you want to use SQL Auth while connecting to MS Sql Server. Set the SONAR_JDBC_USERNAME and SONAR_JDBC_PASSWORD appropriately. Connection pool settings. SONAR_JDBC_MAXACTIVE=60 The maximum number of active connections that can be allocated at the same time, or negative for no limit.

sonarqube, Now I'm trying to setup everything to run from the docker command line as envir I've been able to configure LDAP successfully via editing the configuration file in the docker container. Is this possible does anyone have any examples of configuring docker sonarqube LDAP using environment variables. Push the image to Docker Hub; Pull and run the image; First step, running up the services. Since one of the goals is to obtain the sonarqube report of our project, we should be able to access sonarqube from the jenkins service. Docker compose is a best choice to run services working together. We configure our application services in a yaml file

Sonar LDAP Configuration via Docker Environment Variables , which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) I would like to configure my sonarqube docker containers with certain configuration values for a docker container of SonarQube that would values to a sonarqube container from a file/environment point of view? Installing SonarQube from the Docker Image. See your SonarQube version below for instructions on installing the server from a Docker image. SonarQube 8.2+ Follow these steps for your first installation: Creating the following volumes helps prevent the loss of information when updating to a new version or upgrading to a higher edition:

Comments
  • What would be the best way to handle the passwords and other sensitive data in the sonar-properties file? I don't really want to have it commited in git, I'd rather have the passwords in an environment file/variable.
  • @Zaz Hi, after doing some looking around, I imagine you can use docker-compose's "env_file". Some documentation is here docs.docker.com/compose/compose-file/#envfile
  • Why are you showing a docker registry image when I ask about sonarqube ?
  • No, i showing you a docker service definition using docker-compose to run (for example) a registry. Sonarqube is a container (like the registry) so i suggest u to create your own compose file to start it with custom enviroment variables. By the way u can use docker run and add -e VARNAME=value to archive reach the goal