Container image database configuration

Hey everyone.
Ive configured my Azure Container Image using sonarqube:latest (recently updated to 8.2) Im trying to configure my JDBC data but the H2 DB is not changing for the one I configured.

What I tried:
1 - Configured the sonar.properties file

2 - Added multiple env variables

export SONARQUBE_JDBC_URL=jdbc:sqlserver://;database=
export SONARQUBE_JDBC_USERNAME=
export SONARQUBE_JDBC_PASSWORD=

3 - Restarted from the “Restart Server” button located on the SQ Portal.

Shouldn’t take the conf file data to connect to the DB?

Thanks for your help

You’ll need to do a full restart of SonarQube, not from the UI, in order for these changes to take effect. I think (the world of containers is still a bit new to us :wink: ) this means restarting the container.

Thanks for you answer Colin! Tried that but it seems restarting the whole thing wipes all the stuff i configured. I think that before it executes the run.sh it reads the sonar.properties to get the conf right?

Maybe saving my configuration on a volume? havent tried that because what the documentation (https://hub.docker.com/_/sonarqube) says:

"Use volumes

We recommend creating volumes for the following directories:

  • /opt/sonarqube/conf : for Version 7.9.x only , configuration files, such as sonar.properties ."

And im using 8.2

If you’re using SonarQube v8.2, you should use the environment variables documented in the Environment Variables documentation.

SONAR_JDBC_USERNAME=
SONAR_JDBC_PASSWORD=
SONAR_JDBC_URL=

Use of the environment variables SONARQUBE_JDBC_USERNAME , SONARQUBE_JDBC_PASSWORD , and SONARQUBE_JDBC_URL is deprecated

Have you checked out the Install the Server from the Docker Image docs?

I’d recommend not doing anything with the conf/sonar.properties file – to be quite honest, I’m not sure what overrides what.

@jtesolin I am facing same problem than you…

Did you manage to solve it?

I’ve configured my Azure Container Image using sonarqube:developer:latest.
I did same than @jtesolin.
I configured the sonar.properties file.
I tried to restart like explained in the documentation but I can’t.

@Colin Do you have a solution now?