8.2 environment varible docs are inconsistent & confusing

The docs provide conflicting information for environment variables for 8.2 with Docker.

  • The upgrade guide [1] examples have SONAR_JDBC_... style variables.
  • The install guide [2] examples have SONAR_JDBC_ variables, but right below it warns that they will be deprecated.
  • The 8.2 release upgrade notes [3] says that: “The old way of referencing environment variables in server configuration is deprecated and replaced with the support of default environment variables.” But no details are included about which have been deprecated.
  • The environment variables doc [4] only documents SONAR_JDBC_ style variables.

I’m pretty confused now. What are the right environment variables for 8.2?


[1] - https://docs.sonarqube.org/latest/setup/upgrading/
[2] - https://docs.sonarqube.org/latest/setup/install-server/
[3] - https://docs.sonarqube.org/latest/setup/upgrade-notes/#header-1
[4] - https://docs.sonarqube.org/latest/setup/environment-variables/

Hi Ross,

It is the SONARQUBE_JDBC, with the QUBE, environment variables that will be deprecated. You can use the SONAR_JDBC environment variables.

Hope this helps,

Hah, I haven’t even noticed that distinction!

What about the sonar.jdbc... variables?

sonar.jdbc... are properties that are defined in the file conf/sonar.properties and it’s another way to configure SonarQube. With Docker, we recommend using environment variables that can be defined using docker commands.


Were they also environment variables in the 8.1 beta docker release? I’m supplying them via environment variables to 8.1-enterprise-beta and everything seems to be working. The docs for 8.1 in docker at [1] just link to docker hub, so I think I got it from there. But the 8.1 info has since been removed from the docker hub page, so I can’t really confirm.

Sounds like I need to change to SONAR_JDBC. Will that work with 8.1?


[1] - https://docs.sonarqube.org/8.1/setup/install-server/

Actually from looking at run.sh in 8.2, it seems like sonar. might be the new format:

Please use the environment variables described here: https://docs.sonarqube.org/latest/setup/environment-variables/ instead of sonar.* format (the mechanism for this format is a legacy way of passing server properties to the container and will be removed in the future).

How can you add environment variables to running containers using docker commands?