]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-13892 Add Docker compose yml file to install docs
authormichaelbirnstiehl <michael.birnstiehl@sonarsource.com>
Mon, 28 Sep 2020 21:55:35 +0000 (16:55 -0500)
committersonartech <sonartech@sonarsource.com>
Wed, 30 Sep 2020 20:07:46 +0000 (20:07 +0000)
server/sonar-docs/src/pages/setup/get-started-2-minutes.md
server/sonar-docs/src/pages/setup/install-server.md

index fdf8df06ee6bc7213cb297607f33c063e44cf7fc..8eb6a2bce32cb83c7e0a78200057539a276a826e 100644 (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).
index 1bf6d9b19bcfbb88bba41365322ed90711c2184a..a887b2449805f3933abca59985529a70b30926a3 100644 (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: