Docker-sonarqube: can't comtomize sonar.web.context through env variable

Created on 25 Dec 2019  路  9Comments  路  Source: SonarSource/docker-sonarqube

Please ensure your issue adheres to the following guidelines:
when i use command "

docker run --name local-sonarqube -e sonar.web.context=/sonarqube -p 8083:9000 -d sonarqube
" i got error info like this
image

the point is , when i find this , i want to edit the sonar.web.context through sonar.properties, but i con't do that, because i can't use vi/vim. also i can't use apt-get to install vim, this is so bad.

  • [x] Please check the problem is not already reported, or a known issue documented in develop.md
  • [x] Please include enough details to reproduce the problem: the command executed, the host platform, error messages or relevant logs

Most helpful comment

All the server side properties can be overridden with environment variables starting from SonarQube 8.2 (https://docs.sonarqube.org/latest/setup/environment-variables/) so I'm closing this.

All 9 comments

Hi, could you consider having a prepared sonar.properties file ready on the host, and mount it on the container at startup ?

I tried that, it was't work for me, when i do that, it's really fixed the context-path issue, but the whole system is down, i can't even generate a token for project analyse. it's redirected to login page again and again, which means the token is invalid. i guess the reason could be proxy, but it is real .

I used to face this kind of issue a while ago when placing the SonarQube behind the Apache HTTP.

Please refer to the my old SonarQube Google groups issue

Hope this may help.

All the server side properties can be overridden with environment variables starting from SonarQube 8.2 (https://docs.sonarqube.org/latest/setup/environment-variables/) so I'm closing this.

@michal-duda-sonarsource It appears that those environment variables do not work

docker run -p 9000:9000 -e SONAR_LOG_LEVEL=TRACE sonarqube

as a simple test does nothing for example :-(

Another question: If this feature is going to work will I be able to configure every property (from plugins) via the corresponding env variable?

@kschlesselmann
Thanks for reporting, some of the environment variables indeed do not work in current version. I opened a ticket to track this (it also contains a list of properties affected): SONAR-13272

Regarding plugin properties: only server properties can currently be overridden by environment variables. Feel free to suggest this feature on the community forums.

When is this expected to be fixed? I am having to maintain a special version of our startup script to handle this bug.

We plan to fix it in next version - 8.3.

Fixed in SonarQube 8.3 image.

Was this page helpful?
0 / 5 - 0 ratings