4
votes

I try to install sonarqube container on an Azure WebApp.
It works fine as long as you use the H2 database. Unfortunately, this database is emptied each time the container restarts. Therefore, i'm trying to use SQLServer instead of H2.

Everything works fine when the container is hosted on my machine. But on the WebApp, i get an issue form the underlying ElasticSearch:
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

I'm not a Linux power user, but as far as i could read, it can only be changed on the host machine which i cannot tweak. I've tried to use different containers such as this one:
https://azure.microsoft.com/en-in/resources/templates/101-webapp-linux-sonarqube-azuresql/

I've alsofollowed this tutorial: https://www.natmarchand.fr/sonarqube-azure-webapp-containers/

Nothing works :(
Has anyone succeeded to install a Sonarqube container on Azure with SQL Server as database? Or has anyone solved the issue mentioned above? Thanks a lot for your feedbacks.

3
I believe this article meets your needs: medium.com/rowden/…gcleite
did you tried to deploy SQL Server on different container and Sonarqube on another and then connect them! The issue is simple a normal container cannot able to host. Container needs more space :)Dupinder Singh
In fact it seems the issue is due to a validation made by elastic search, which is not made when using the internal H2 database (it can be tried with an official container). The article mentionned by gcleite seems promising but i have to dig a bit more.Lionel D

3 Answers

2
votes

Yes. I was able to solve. There is a environment variable in SQ code - Dsonar.es.bootstrap.checks.disable if set to true will not force the bootstrap checks. We can not set this env variable from Azure apps service since azure will replace "." to "-". So the only way to make it work is to use custom docker image and pass the param -Dsonar.es.bootstrap.checks.disable in the custom run script. If you need more details please checkout my page here - https://shubhamgargcth.github.io/SonarQubeAzureAppService/

-1
votes
    ulimits:
      nofile:
       soft: 65536
       hard: 65536

is your friend.

This example seems to be the exact fit for your case: https://github.com/MrZoidberg/docker-sonarqube/blob/master/recipes/docker-compose-postgres-example.yml

-1
votes

I tried SonarQube in my team and deployed on Azure with SqlServer in a linux VM.

That was simple

These are 2 articles which can help you step by step, how to deploy Sonarqube on azure.

https://tariqabubaker.wordpress.com/2017/07/31/step-by-step-how-create-sonarqube-vm-using-ms-azure-and-configure-it-to-be-integrated-with-vsts/

https://www.azuredevopslabs.com/labs/vstsextend/sonarqube/sonarqube-arm/

PS: My SQLServer was running outside of SonarQube container/VM I deployed SQL Server and create one DB and then connect DB with SonarQube config.