Running Sonarqube in Azure Container Instance

I’m trying to run the latest Sonarqube docker image in Azure Container Instance, but I get:

ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

I saw “Docker Host Requirements” on https://hub.docker.com/_/sonarqube/ but I can’t change that with ACI.

Hi @Brian_Balderston,

Indeed, this is a hard requirement for the embedded Elasticsearch. And running Elasticsearch on ACI is known to be tricky.

Unfortunately, I have no easy solution to offer you right now :man_shrugging: . You could try and contact Azure support, or search for solutions on how to run Elasticsearch on ACI. The same (or at least, similar) solution would apply to running SonarQube, although it may require you create a custom image, which extends the official one.

If you do find a solution, we’d love to hear about it.

1 Like

I had the same issue running on EKS. I solved the problem running an initContainer:

  initContainers:
  - name: sonarqube-es-init
    image: busybox:1.27.2
    command: ['sysctl', '-w', 'vm.max_map_count=262144']
    securityContext:
      privileged: true

That should get you running.

This is Azure Container Instance, not AKS, but I tried (per https://docs.microsoft.com/en-us/azure/container-instances/container-instances-init-container):

initContainers:
- name: sonarqube-es-init
  properties:
    image: busybox:1.27.2
    command: ['sysctl', '-w', 'vm.max_map_count=262144']

Which ACI accepts but ultimately fails to deploy.

I just created a modified version of the official image that works on ACI … I just tested it … I will put more details on Docker Hub.

But if you want to try:

https://hub.docker.com/repository/docker/terryvel/sonarqube-aci