title: How to bind mounted persistent volumes on docker ? I'm trying to run Sonarqube on docker
body: <p>I want to run SonarQube on docker. When I run the whiteout volume persist option, it works properly with this command:   </p>
  
  <pre><code>docker run -d --name sonarqube -p 9000:9000 sonarqube
  </code></pre>
  
  <p>But when I try to set bind-mounted persistent volumes, my docker doesn't start. The docker command used is:</p>
  
  <pre><code> docker run -d --name sonarqube \
  -p 9000:9000 \
  -v /opt/docker-mounts/sonaarqube/conf:/opt/sonarqube/conf \
  -v /opt/docker-mounts/sonaarqube/data:/opt/sonarqube/data \
  -v /opt/docker-mounts/sonaarqube/logs:/opt/sonarqube/logs \
  -v /opt/docker-mounts/sonaarqube/extensions:/opt/sonarqube/extensions \
  sonarqube
  </code></pre>
  
  <p>Note: I run docker command with root privilege. </p>
  
  <p>I use this SonarQube image from Docker Hub: <a href="https://hub.docker.com/_/sonarqube?tab=description" rel="nofollow noreferrer">https://hub.docker.com/_/sonarqube?tab=description</a></p>
  
  <p>I get this Error in docker logs :</p>
  
  <blockquote>
    <p>>
    06:42:37.293 [main] WARN org.sonar.application.config.AppSettingsLoaderImpl - Configuration file not found: /opt/sonarqube/conf/sonar.properties
    2019.07.07 06:42:37 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
    2019.07.07 06:42:37 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
    2019.07.07 06:42:37 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
    2019.07.07 06:42:38 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
    OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
    2019.07.07 06:42:38 INFO  app[][o.e.p.PluginsService] no modules loaded
    2019.07.07 06:42:38 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]</p>
    
    <blockquote>
      <p>2019-07-07 06:42:41,143 main ERROR Unable to create file /opt/sonarqube/logs/es.log java.io.IOException: Permission denied
          at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
          at java.base/java.io.File.createNewFile(File.java:1024)
          at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:628)
          at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:608)
          at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:113)
          at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:114)
          at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:188)
          at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:145)
          at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:61)
          at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:123)
          at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
          at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
          at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
          at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
          at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
          at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
          at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
          at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
          at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
          at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
          at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
          at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
          at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
          at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
          at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
          at org.elasticsearch.cli.Command.main(Command.java:90)
          at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116)
          at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)</p>
      
      <p>2019-07-07 06:42:41,148 main ERROR Could not create plugin of type class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@5dcd8c7a] unable to create manager for [/opt/sonarqube/logs/es.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@2250b9f2[pattern=/opt/sonarqube/logs/es.%d{yyyy-MM-dd}.log, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[TimeBasedTriggeringPolicy(nextRolloverMillis=0, interval=1, modulate=true)]), strategy=DefaultRolloverStrategy(min=-2147483648, max=2147483647, useMax=false), advertiseURI=null, layout=%d{yyyy.MM.dd HH:mm:ss} %-5level es[][%logger{1.}] %msg%n, filePermissions=null, fileOwner=null]] java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@5dcd8c7a] unable to create manager for [/opt/sonarqube/logs/es.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@2250b9f2[pattern=/opt/sonarqube/logs/es.%d{yyyy-MM-dd}.log, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[TimeBasedTriggeringPolicy(nextRolloverMillis=0, interval=1, modulate=true)]), strategy=DefaultRolloverStrategy(min=-2147483648, max=2147483647, useMax=false), advertiseURI=null, layout=%d{yyyy.MM.dd HH:mm:ss} %-5level es[][%logger{1.}] %msg%n, filePermissions=null, fileOwner=null]]
          at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:115)
          at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:114)
          at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:188)
          at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:145)
          at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:61)
          at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:123)
          at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
          at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
          at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
          at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
          at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
          at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
          at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
          at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
          at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
          at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
          at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
          at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
          at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
          at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
          at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
          at org.elasticsearch.cli.Command.main(Command.java:90)
          at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116)
          at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)</p>
    </blockquote>
    
    <p>2019-07-07 06:42:41,152 main ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender
        at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod(PluginBuilder.java:235)
        at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:135)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
        at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
        at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
        at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
        at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
        at org.elasticsearch.cli.Command.main(Command.java:90)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)</p>
    
    <blockquote>
      <p>2019-07-07 06:42:41,154 main ERROR Null object returned for RollingFile in Appenders.
      2019-07-07 06:42:41,154 main ERROR Unable to locate appender "file_es" for logger config "root"
      2019.07.07 06:42:41 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
      2019.07.07 06:42:41 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
      2019.07.07 06:42:41 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped</p>
    </blockquote>
  </blockquote>