3. Run the image with your database properties defined using the -e
environment variable flag:
- $> docker run -d --name sonarqube \
- -p 9000:9000 \
- -e SONAR_JDBC_URL=... \
- -e SONAR_JDBC_USERNAME=... \
- -e SONAR_JDBC_PASSWORD=... \
- -v sonarqube_data:/opt/sonarqube/data \
- -v sonarqube_extensions:/opt/sonarqube/extensions \
- -v sonarqube_logs:/opt/sonarqube/logs \
- <image_name>
For docker-based setups, environment variables supersede all parameters that were provided with properties. See Docker environment variables for more details.
We recommend creating volumes for the following directories:
/opt/sonarqube/data
: data files, such as the embedded H2 database and Elasticsearch indexes/opt/sonarqube/logs
: contains SonarQube logs about access, web process, CE process, Elasticsearch logs/opt/sonarqube/extensions
: for 3rd party pluginsWarning: You cannot use the same volumes on multiple instances of SonarQube.
main ERROR Unable to create file /opt/sonarqube/logs/es.log java.io.IOException: Permission denied
修改映射卷的权限为777