Browse Source

SONAR-13892 Add Docker compose yml file to install docs

tags/8.5.0.37579
michaelbirnstiehl 3 years ago
parent
commit
af994fd94c

+ 4
- 4
server/sonar-docs/src/pages/setup/get-started-2-minutes.md View File

@@ -7,10 +7,10 @@ You've heard about how [SonarQube](https://www.sonarqube.org/) can help you writ
Once you're ready to set up a production instance, take a look at the [Install SonarQube](/setup/install-server/) documentation.

## Installing a local instance of SonarQube
You can install SonarQube from either the [zip file](https://www.sonarqube.org/downloads/) or the [Docker image](https://hub.docker.com/_/sonarqube/). Click the method you prefer below to expand the installation instructions:
You can evaluate SonarQube using a traditional installation with the [zip file](https://www.sonarqube.org/downloads/) or you can spin up a Docker container using one of our [Docker images](https://hub.docker.com/_/sonarqube/). Click the method you prefer below to expand the installation instructions:

[[collapse]]
| ## From a zip file
| ## From the zip file
|
| 1. [Download](https://www.sonarqube.org/downloads/) the SonarQube Community Edition zip file.
|
@@ -31,13 +31,13 @@ You can install SonarQube from either the [zip file](https://www.sonarqube.org/d
| 4. Log in to [http://localhost:9000](http://localhost:9000) using System Administrator credentials (login=admin, password=admin).

[[collapse]]
| ## From a Docker image
| ## From the Docker image
| Find the Community Edition Docker image on [Docker Hub](https://hub.docker.com/_/sonarqube/).
|
| 1. Start the server by running:
|
| ```console
| $ docker run -d --name sonarqube -p 9000:9000 <image_name>
| $ docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:latest
| ```
|
| 2. Log in to [http://localhost:9000](http://localhost:9000) with System Administrator credentials (login=admin, password=admin).

+ 45
- 2
server/sonar-docs/src/pages/setup/install-server.md View File

@@ -187,11 +187,11 @@ Follow these steps for your first installation:
Create the volumes with the following commands:
```bash
$> docker volume create --name sonarqube_data
$> docker volume create --name sonarqube_extensions
$> docker volume create --name sonarqube_logs
$> docker volume create --name sonarqube_extensions
```
[[warning]]
| Make sure you're using [volumes](https://docs.docker.com/storage/volumes/) as shown with the above commands, and not [bind mounts](https://docs.docker.com/storage/bind-mounts/). Using bind mounts prevents plugins and languages from populating correctly.
| Make sure you're using [volumes](https://docs.docker.com/storage/volumes/) as shown with the above commands, and not [bind mounts](https://docs.docker.com/storage/bind-mounts/). Using bind mounts prevents plugins from populating correctly.

2. Drivers for supported databases (except Oracle) are already provided. If you're using an Oracle database, you need to add the JDBC driver to the `sonar_extensions` volume. To do this:

@@ -227,6 +227,49 @@ Follow these steps for your first installation:
[[warning]]
| Use of the environment variables `SONARQUBE_JDBC_USERNAME`, `SONARQUBE_JDBC_PASSWORD`, and `SONARQUBE_JDBC_URL` is deprecated and will stop working in future releases.

####**Example Docker Compose configuration**
If you're using [Docker Compose](https://docs.docker.com/compose/), use the following example as a reference when configuring your `.yml` file. Click the heading below to expand the `.yml` file.

[[collapse]]
| ## Docker Compose .yml file example
|
| ```
| version: "3"
|
| services:
| sonarqube:
| image: sonarqube:8-community
| depends_on:
| - db
| environment:
| SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
| SONAR_JDBC_USERNAME: sonar
| SONAR_JDBC_PASSWORD: sonar
| volumes:
| - sonarqube_data:/opt/sonarqube/data
| - sonarqube_extensions:/opt/sonarqube/extensions
| - sonarqube_logs:/opt/sonarqube/logs
| - sonarqube_temp:/opt/sonarqube/temp
| ports:
| - "9000:9000"
| db:
| image: postgres:12
| environment:
| POSTGRES_USER: sonar
| POSTGRES_PASSWORD: sonar
| volumes:
| - postgresql:/var/lib/postgresql
| - postgresql_data:/var/lib/postgresql/data
|
| volumes:
| sonarqube_data:
| sonarqube_extensions:
| sonarqube_logs:
| sonarqube_temp:
| postgresql:
| postgresql_data:
| ```

### SonarQube 7.9.x LTS

Follow these steps for your first installation:

Loading…
Cancel
Save