<p>You can simply put a <code>sonar.properties</code> file under <code>/opt/docker-sonar/conf/</code>. This file will be available inside the container under <code>/opt/sonarqube/conf/</code>, because the folder gets mounted as volume.</p>
<p>A full example for a <code>sonar.properties</code> file can be found on <a href="https://github.com/SonarSource/sonarqube/blob/master/sonar-application/src/main/assembly/conf/sonar.properties" rel="nofollow noreferrer">github</a>. However all you need to enter is:</p>
<pre><code>sonar.ce.javaOpts=-Xmx&lt;XMX_VALUE -Xms&lt;XMS_VALUE&gt; -XX:+HeapDumpOnOutOfMemoryError
</code></pre>

CC BY-SA 4.0
2020-03-03T11:32:03.833Z
I'd like to correct the mounted path to `/opt/sonarqube/conf`. But as it is only one character, I am not allowed to.
tgr
CC BY-SA 4.0
2018-05-16T09:17:25.653Z
2021-01-27T11:23:50.210Z
2021-01-27T11:23:50.210Z
jayeshkh007
<p><strong>This Question has been answered on <a href="https://stackoverflow.com/a/50366800/1374536">Stackoverflow</a> too.</strong></p>

<hr>

<p>I have a Sonarqube instance running as a docker container. Since I updated it to version 7.1 the analysis of my greatest project fails with <code>GC limit exceeded</code>. If I restart the server, it might succeed once. After a while of researching this issue, I am tempted to believe, I need to increase the <code>Xmx</code> value for the background task.</p>

<p>Where and how can I configure this parameter?</p>

<hr>

<p><strong>docker-compose.yml</strong></p>

<pre><code>version: "2"
services:

  postgres:
    image: postgres:9-alpine
    container_name: postgres
    restart: always
    volumes:
      - /opt/docker-postgres/etc:/etc/postgresql
      - /opt/docker-postgres/log:/var/log/postgresql
      - /opt/docker-postgres/data:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: sonar
      POSTGRES_USER: &lt;SONAR_USER&gt;
      POSTGRES_PASSWORD: &lt;SONAR_PASSWORD&gt;

  sonar:
    image: sonarqube:alpine
    container_name: sonar
    restart: always
    ports:
      - "9000:9000"
      - "9092:9092"
    environment:
      SONARQUBE_JDBC_USERNAME: &lt;SONAR_USER&gt;
      SONARQUBE_JDBC_PASSWORD: &lt;SONAR_PASSWORD&gt;
      SONARQUBE_JDBC_URL: jdbc:postgresql://postgres/sonar
    volumes:
      - /opt/docker-sonar/conf:/opt/sonarqube/conf
      - /opt/docker-sonar/data:/opt/sonarqube/data
      - /opt/docker-sonar/extensions:/opt/sonarqube/extensions
      - /opt/docker-sonar/bundled-plugins:/opt/sonarqube/lib/bundled-plugins
</code></pre>

<docker><java><sonarqube>
How to change Xmx settings for sonar runner?
tgr
# How to change Xmx settings for sonar runner?

(Asked by: username_0 on 2018-05-16)

This Question has been answered on Stackoverflow too.

I have a Sonarqube instance running as a docker container. Since I updated it to version 7.1 the analysis of my greatest project fails with GC limit exceeded. If I restart the server, it might succeed once. After a while of researching this issue, I am tempted to believe, I need to increase the Xmx value for the background task.
Where and how can I configure this parameter?

docker-compose.yml
version: "2"
services:

  posusername_0es:
    image: posusername_0es:9-alpine
    container_name: posusername_0es
    restart: always
    volumes:
      - /opt/docker-posusername_0es/etc:/etc/posusername_0esql
      - /opt/docker-posusername_0es/log:/var/log/posusername_0esql
      - /opt/docker-posusername_0es/data:/var/lib/posusername_0esql/data
    environment:
      POSTGRES_DB: sonar
      POSTGRES_USER: 
      POSTGRES_PASSWORD: 

  sonar:
    image: sonarqube:alpine
    container_name: sonar
    restart: always
    ports:
      - "9000:9000"
      - "9092:9092"
    environment:
      SONARQUBE_JDBC_USERNAME: 
      SONARQUBE_JDBC_PASSWORD: 
      SONARQUBE_JDBC_URL: jdbc:posusername_0esql://posusername_0es/sonar
    volumes:
      - /opt/docker-sonar/conf:/opt/sonarqube/conf
      - /opt/docker-sonar/data:/opt/sonarqube/data
      - /opt/docker-sonar/extensions:/opt/sonarqube/extensions
      - /opt/docker-sonar/bundled-plugins:/opt/sonarqube/lib/bundled-plugins

**Tags:** docker, java, sonarqube


---

## 1 answers

### Answer by username_1 on 2018-05-16. Score: 2 | Accepted answer

You can simply put a sonar.properties file under /opt/docker-sonar/conf/. This file will be available inside the container under /opt/sonarqube/conf/, because the folder gets mounted as volume.
A full example for a sonar.properties file can be found on github. However all you need to enter is:
sonar.ce.javaOpts=-Xmx -XX:+HeapDumpOnOutOfMemoryError

> **Comments:**
> **username_0**: I'd like to correct the mounted path to `/opt/sonarqube/conf`. But as it is only one character, I am not allowed to.  

---

