Skip to content

Commit 9e5ea4d

Browse files
authored
Merge pull request docker-library#1600 from SonarSource/master
Adding Sonarqube 7.9.1 specific instructions
2 parents f4fe791 + c92d514 commit 9e5ea4d

File tree

1 file changed

+56
-4
lines changed

1 file changed

+56
-4
lines changed

sonarqube/content.md

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,55 @@ By default, the image will use an embedded H2 database that is not suited for pr
5555
5656
Setup a database by following the "Installing the Database" section of https://docs.sonarqube.org/latest/setup/install-server/.
5757

58-
### Use bind-mounted folders
58+
### Use bind-mounted folders or volumes
5959

60-
The images contain the SonarQube installation at `/opt/sonarqube`. You need to use bind-mounted folders to override selected files or directories :
60+
The images contain the SonarQube installation folders at `/opt/sonarqube`. You will need to bind them to your host to override selected files or directories :
6161

6262
- `/opt/sonarqube/conf`: configuration files, such as `sonar.properties`
6363
- `/opt/sonarqube/data`: data files, such as the embedded H2 database and Elasticsearch indexes
6464
- `/opt/sonarqube/logs`: contains SonarQube logs about access, web process, CE process, Elasticsearch logs
6565
- `/opt/sonarqube/extensions`: plugins, such as language analyzers
6666

67-
### First installation
67+
### SonarQube 7.9.x LTS first installation
68+
69+
Follow these steps for your first installation:
70+
71+
1. Create volumes `sonarqube_conf`, `sonarqube_data`, `sonarqube_logs`, and `sonarqube_extensions` and start the image with the following command. This will populate all the volumes (copying default plugins, create the Elasticsearch data folder, create the sonar.properties configuration file). Watch the logs, and, once the container is properly started, you can force-exit (ctrl+c) and proceed to the next step.
72+
73+
```console
74+
$ docker run --rm \
75+
-p 9000:9000 \
76+
-v sonarqube_conf:/opt/sonarqube/conf \
77+
-v sonarqube_extensions:/opt/sonarqube/extensions \
78+
-v sonarqube_logs:/opt/sonarqube/logs \
79+
-v sonarqube_data:/opt/sonarqube/data \
80+
%%IMAGE%%
81+
```
82+
83+
2. Configure sonar.properties to configure the database JDBC URL. Templates are available for every supported database. Just uncomment and configure the template you need. Please note that due to [SONAR-12501](https://jira.sonarsource.com/browse/SONAR-12501), providing `sonar.jdbc.username` and `sonar.jdbc.password` in `sonar.properties` is not working, and you will need to explicitly define theses values in the docker run command with the `-e` flag.
84+
85+
```plain
86+
#Example for PostgreSQL
87+
sonar.jdbc.url=jdbc:postgresql://localhost/sonarqube
88+
```
89+
90+
3. Drivers for the supported databases (except Oracle) are already provided. Do not replace the provided drivers; they are the only ones supported. For Oracle, copy the JDBC driver into `$SONARQUBE_HOME/extensions/jdbc-driver/oracle`.
91+
92+
4. Run the image with your JDBC username and password :
93+
94+
```console
95+
$ docker run -d --name sonarqube \
96+
-p 9000:9000 \
97+
-e sonar.jdbc.username=sonar \
98+
-e sonar.jdbc.password=sonar \
99+
-v sonarqube_conf:/opt/sonarqube/conf \
100+
-v sonarqube_extensions:/opt/sonarqube/extensions \
101+
-v sonarqube_logs:/opt/sonarqube/logs \
102+
-v sonarqube_data:/opt/sonarqube/data \
103+
%%IMAGE%%
104+
```
105+
106+
### SonarQube 8.x first installation
68107

69108
Follow these steps for your first installation:
70109

@@ -109,11 +148,24 @@ Follow these steps for your first installation:
109148

110149
## Upgrade SonarQube
111150

151+
### From 7.9.x LTS to another 7.9.x LTS version
152+
153+
Take a look at the [Upgrade Guide](https://docs.sonarqube.org/latest/setup/upgrading/).
154+
No specific Docker operations are needed, just use the new tag.
155+
156+
### From 7.9.x LTS to 8.x
157+
158+
Follow the next section instructions, but instead of upgrading from folders to folders, you will migrate your volumes to new folders.
159+
160+
> Starting with the version 8.0, you can move your `sonar.jdbc.username` and `sonar.jdbc.password` value to `sonar.properties` instead of passing them with the `-e` flag.
161+
162+
### From 8.x
163+
112164
Follow these steps to upgrade SonarQube:
113165

114166
1. Create a new `sonarqube_home_new` folder and backup your old folder.
115167

116-
2. Update the environment variable `$SONARQUBE_HOME` pointing to it. Backup the old one:
168+
2. Update the environment variable `$SONARQUBE_HOME` pointing to it:
117169

118170
```console
119171
$ mkdir /path/to/your/filesystem/sonarqube_home_new

0 commit comments

Comments
 (0)