[bitnami/sonarqube] Release 10.3.0-debian-11-r6 (#55175)

Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
This commit is contained in:
Bitnami Bot
2024-01-20 06:07:38 +01:00
committed by GitHub
parent 4d652b1e19
commit 342345420a
4 changed files with 72 additions and 82 deletions

View File

@@ -8,10 +8,10 @@ ARG TARGETARCH
LABEL com.vmware.cp.artifact.flavor="sha256:1e1b4657a77f0d47e9220f0c37b9bf7802581b93214fff7d1bd2364c8bf22e8e" \
org.opencontainers.image.base.name="docker.io/bitnami/minideb:bullseye" \
org.opencontainers.image.created="2023-12-24T09:34:54Z" \
org.opencontainers.image.created="2024-01-20T04:03:24Z" \
org.opencontainers.image.description="Application packaged by VMware, Inc" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.ref.name="10.3.0-debian-11-r5" \
org.opencontainers.image.ref.name="10.3.0-debian-11-r6" \
org.opencontainers.image.title="sonarqube" \
org.opencontainers.image.vendor="VMware, Inc." \
org.opencontainers.image.version="10.3.0"
@@ -28,7 +28,7 @@ RUN install_packages acl ca-certificates curl libbsd0 libedit2 libffi7 libgcc-s1
RUN mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ ; \
COMPONENTS=( \
"postgresql-client-16.1.0-0-linux-${OS_ARCH}-debian-11" \
"java-17.0.9-11-6-linux-${OS_ARCH}-debian-11" \
"java-17.0.10-13-0-linux-${OS_ARCH}-debian-11" \
"sonarqube-10.3.0-3-linux-${OS_ARCH}-debian-11" \
) ; \
for COMPONENT in "${COMPONENTS[@]}"; do \
@@ -43,6 +43,7 @@ RUN mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ ; \
RUN apt-get update && apt-get upgrade -y && \
apt-get clean && rm -rf /var/lib/apt/lists /var/cache/apt/archives
RUN chmod g+rwX /opt/bitnami
RUN find / -perm /6000 -type f -exec chmod a-s {} \; || true
COPY rootfs /
RUN /opt/bitnami/scripts/java/postunpack.sh

View File

@@ -3,7 +3,7 @@
"arch": "amd64",
"distro": "debian-11",
"type": "NAMI",
"version": "17.0.9-11-6"
"version": "17.0.10-13-0"
},
"postgresql-client": {
"arch": "amd64",

View File

@@ -10,7 +10,7 @@ fi
script=$1
exit_code="${2:-96}"
fail_if_not_present="${3:-y}"
fail_if_not_present="${3:-n}"
if test -f "$script"; then
sh $script

View File

@@ -10,8 +10,7 @@ Trademarks: This software listing is packaged by Bitnami. The respective tradema
## TL;DR
```console
curl -sSL https://raw.githubusercontent.com/bitnami/containers/main/bitnami/sonarqube/docker-compose.yml > docker-compose.yml
docker-compose up -d
docker run --name sonarqube bitnami/sonarqube:latest
```
**Warning**: This quick setup is only intended for development environments. You are encouraged to change the insecure default credentials and check out the available configuration options in the [Environment Variables](#environment-variables) section for a more secure deployment.
@@ -65,19 +64,8 @@ docker build -t bitnami/APP:latest .
SonarQube&trade; requires access to a PostgreSQL database to store information. We'll use the [Bitnami Docker Image for PostgreSQL](https://github.com/bitnami/containers/tree/main/bitnami/postgresql) for the database requirements.
### Run the application using Docker Compose
The main folder of this repository contains a functional [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/sonarqube/docker-compose.yml) file. Run the application using it as shown below:
```console
curl -sSL https://raw.githubusercontent.com/bitnami/containers/main/bitnami/sonarqube/docker-compose.yml > docker-compose.yml
docker-compose up -d
```
### Using the Docker Command Line
If you want to run the application manually instead of using `docker-compose`, these are the basic steps you need to run:
#### Step 1: Create a network
```console
@@ -115,6 +103,17 @@ docker run -d --name sonarqube \
Access your application at `http://your-ip/`
### Run the application using Docker Compose
```console
curl -sSL https://raw.githubusercontent.com/bitnami/containers/main/bitnami/sonarqube/docker-compose.yml > docker-compose.yml
docker-compose up -d
```
Please be aware this file has not undergone internal testing. Consequently, we advise its use exclusively for development or testing purposes. For production-ready deployments, we highly recommend utilizing its associated [Bitnami Helm chart](https://github.com/bitnami/charts/tree/main/bitnami/apache).
If you detect any issue in the `docker-compose.yaml` file, feel free to report it or contribute with a fix by following our [Contributing Guidelines](https://github.com/bitnami/containers/blob/main/CONTRIBUTING.md).
## Persisting your application
If you remove the container all your data will be lost, and the next time you run the image the database will be reinitialized. To avoid this loss of data, you should mount a volume that will persist even after the container is removed.
@@ -190,9 +189,50 @@ docker run -d --name sonarqube \
### Environment variables
#### Customizable environment variables
| Name | Description | Default Value |
|---------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| `SONARQUBE_MOUNTED_PROVISIONING_DIR` | Directory for SonarQube initial provisioning. | `/bitnami/sonarqube-provisioning` |
| `SONARQUBE_DATA_TO_PERSIST` | Files to persist relative to the SonarQube installation directory. To provide multiple values, separate them with a whitespace. | `${SONARQUBE_DATA_DIR} ${SONARQUBE_EXTENSIONS_DIR}` |
| `SONARQUBE_PORT_NUMBER` | SonarQube Web application port number. | `9000` |
| `SONARQUBE_ELASTICSEARCH_PORT_NUMBER` | SonarQube Elasticsearch application port number. | `9001` |
| `SONARQUBE_START_TIMEOUT` | Timeout for the application to start in seconds. | `300` |
| `SONARQUBE_SKIP_BOOTSTRAP` | Whether to perform initial bootstrapping for the application. | `no` |
| `SONARQUBE_WEB_CONTEXT` | SonarQube prefix used to access to the application. | `/` |
| `SONARQUBE_USERNAME` | SonarQube user name. | `admin` |
| `SONARQUBE_PASSWORD` | SonarQube user password. | `bitnami` |
| `SONARQUBE_EMAIL` | SonarQube user e-mail address. | `user@example.com` |
| `SONARQUBE_DATABASE_HOST` | Database server host. | `$SONARQUBE_DEFAULT_DATABASE_HOST` |
| `SONARQUBE_DATABASE_PORT_NUMBER` | Database server port. | `5432` |
| `SONARQUBE_DATABASE_NAME` | Database name. | `bitnami_sonarqube` |
| `SONARQUBE_DATABASE_USER` | Database user name. | `bn_sonarqube` |
#### Read-only environment variables
| Name | Description | Value |
|-----------------------------------|------------------------------------------------------|--------------------------------------------|
| `SONARQUBE_BASE_DIR` | SonarQube installation directory. | `${BITNAMI_ROOT_DIR}/sonarqube` |
| `SONARQUBE_DATA_DIR` | Directory for SonarQube data files. | `${SONARQUBE_BASE_DIR}/data` |
| `SONARQUBE_EXTENSIONS_DIR` | Directory for SonarQube extensions. | `${SONARQUBE_BASE_DIR}/extensions` |
| `SONARQUBE_CONF_DIR` | Directory for SonarQube configuration files. | `${SONARQUBE_BASE_DIR}/conf` |
| `SONARQUBE_CONF_FILE` | Configuration file for SonarQube. | `${SONARQUBE_CONF_DIR}/sonar.properties` |
| `SONARQUBE_LOGS_DIR` | Directory for SonarQube log files. | `${SONARQUBE_BASE_DIR}/logs` |
| `SONARQUBE_LOG_FILE` | SonarQube log file. | `${SONARQUBE_LOGS_DIR}/sonar.log` |
| `SONARQUBE_TMP_DIR` | Directory for SonarQube temporary files. | `${SONARQUBE_BASE_DIR}/temp` |
| `SONARQUBE_PID_FILE` | SonarQube PID file. | `${SONARQUBE_BASE_DIR}/pids/SonarQube.pid` |
| `SONARQUBE_BIN_DIR` | SonarQube directory for binary executables. | `${SONARQUBE_BASE_DIR}/bin/linux-x86-64` |
| `SONARQUBE_VOLUME_DIR` | SonarQube directory for mounted configuration files. | `${BITNAMI_VOLUME_DIR}/sonarqube` |
| `SONARQUBE_DAEMON_USER` | SonarQube system user. | `sonarqube` |
| `SONARQUBE_DAEMON_USER_ID` | SonarQube system user ID. | `1001` |
| `SONARQUBE_DAEMON_GROUP` | SonarQube system group. | `sonarqube` |
| `SONARQUBE_DAEMON_GROUP_ID` | SonarQube system group. | `1001` |
| `SONARQUBE_DEFAULT_DATABASE_HOST` | Default database server host. | `postgresql` |
| `SONARQUBE_DEFAULT_DATABASE_HOST` | Default database server host. | `127.0.0.1` |
When you start the SonarQube&trade; image, you can adjust the configuration of the instance by passing one or more environment variables either on the docker-compose file or on the `docker run` command line. If you want to add a new environment variable:
- For docker-compose add the variable name and value under the application section in the [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/sonarqube/docker-compose.yml) file present in this repository:
* For docker-compose add the variable name and value under the application section in the [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/sonarqube/docker-compose.yml) file present in this repository:
```yaml
sonarqube:
@@ -202,7 +242,7 @@ When you start the SonarQube&trade; image, you can adjust the configuration of t
...
```
- For manual execution add a `--env` option with each variable and value:
* For manual execution add a `--env` option with each variable and value:
```console
$ docker run -d --name sonarqube -p 80:8080 -p 443:8443 \
@@ -212,64 +252,13 @@ When you start the SonarQube&trade; image, you can adjust the configuration of t
bitnami/sonarqube:latest
```
Available environment variables:
### Examples
#### User and Site configuration
- `SONARQUBE_USERNAME`: SonarQube&trade; application username. Default: **admin**
- `SONARQUBE_PASSWORD`: SonarQube&trade; application password. Default: **bitnami**
- `SONARQUBE_EMAIL`: SonarQube&trade; application email. Default: **user@example.com**
- `SONARQUBE_SKIP_BOOTSTRAP`: Whether to skip performing the initial bootstrapping for the application. This is necessary in case you use a database that already has SonarQube&trade; data. Default: **no**
- `SONARQUBE_PORT_NUMBER`: SonarQube&trade; Web application port number. Default: **9000**
- `SONARQUBE_ELASTICSEARCH_PORT_NUMBER`: SonarQube&trade; Elasticsearch application port number. Default: **9001**
- `SONARQUBE_WEB_CONTEXT`: SonarQube&trade; prefix used to access to the application. Default: **/**
- `SONARQUBE_MAX_HEAP_SIZE`: Maximum heap size for SonarQube&trade; services (CE, Search and Web). No defaults.
- `SONARQUBE_MIN_HEAP_SIZE`: Minimum heap size for SonarQube&trade; services (CE, Search and Web). No defaults.
- `SONARQUBE_CE_JAVA_ADD_OPTS`: Additional Java options for Compute Engine. No defaults.
- `SONARQUBE_ELASTICSEARCH_JAVA_ADD_OPTS`: Additional Java options for Elasticsearch. No defaults.
- `SONARQUBE_WEB_JAVA_ADD_OPTS`: Additional Java options for Web. No defaults.
- `SONARQUBE_EXTRA_PROPERTIES`: Comma separated list of properties to be set in the sonar.properties file, e.g. `my.sonar.property1=property_value,my.sonar.property2=property_value`. No defaults.
- `SONARQUBE_START_TIMEOUT`: Timeout for the application to start in seconds. Default: **300**.
#### Database connection configuration
- `SONARQUBE_DATABASE_HOST`: Hostname for PostgreSQL server. Default: **postgresql**
- `SONARQUBE_DATABASE_PORT_NUMBER`: Port used by the PostgreSQL server. Default: **5432**
- `SONARQUBE_DATABASE_NAME`: Database name that SonarQube&trade; will use to connect with the database. Default: **bitnami_sonarqube**
- `SONARQUBE_DATABASE_USER`: Database user that SonarQube&trade; will use to connect with the database. Default: **bn_sonarqube**
- `SONARQUBE_DATABASE_PASSWORD`: Database password that SonarQube&trade; will use to connect with the database. No default.
- `ALLOW_EMPTY_PASSWORD`: It can be used to allow blank passwords. Default: **no**
#### Create a database for SonarQube&trade; using postgresql-client
- `POSTGRESQL_CLIENT_DATABASE_HOST`: Hostname for the PostgreSQL server. Default: **postgresql**
- `POSTGRESQL_CLIENT_DATABASE_PORT_NUMBER`: Port used by the PostgreSQL server. Default: **5432**
- `POSTGRESQL_CLIENT_POSTGRES_USER`: Database admin user. Default: **root**
- `POSTGRESQL_CLIENT_POSTGRES_PASSWORD`: Database password for the database admin user. No default.
- `POSTGRESQL_CLIENT_CREATE_DATABASE_NAMES`: List of new databases to be created by the postgresql-client module. No default.
- `POSTGRESQL_CLIENT_CREATE_DATABASE_USER`: New database user to be created by the postgresql-client module. No default.
- `POSTGRESQL_CLIENT_CREATE_DATABASE_PASSWORD`: Database password for the `POSTGRESQL_CLIENT_CREATE_DATABASE_USER` user. No default.
- `POSTGRESQL_CLIENT_CREATE_DATABASE_EXTENSIONS`: PostgreSQL extensions to enable in the specified database during the first initialization. No default.
- `POSTGRESQL_CLIENT_EXECUTE_SQL`: SQL code to execute in the PostgreSQL server. No defaults.
- `ALLOW_EMPTY_PASSWORD`: It can be used to allow blank passwords. Default: **no**
#### SMTP Configuration
To configure SonarQube&trade; to send email using SMTP you can set the following environment variables:
- `SONARQUBE_SMTP_HOST`: SMTP host.
- `SONARQUBE_SMTP_PORT_NUMBER`: SMTP port.
- `SONARQUBE_SMTP_USER`: SMTP account user.
- `SONARQUBE_SMTP_PASSWORD`: SMTP account password.
- `SONARQUBE_SMTP_PROTOCOL`: If specified, SMTP protocol to use. Allowed values: *tls*, *ssl*. No default.
#### Examples
##### SMTP configuration using a Gmail account
#### SMTP configuration using a Gmail account
This would be an example of SMTP configuration using a Gmail account:
- Modify the [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/sonarqube/docker-compose.yml) file present in this repository:
* Modify the [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/sonarqube/docker-compose.yml) file present in this repository:
```yaml
sonarqube:
@@ -285,7 +274,7 @@ This would be an example of SMTP configuration using a Gmail account:
...
```
- For manual execution:
* For manual execution:
```console
$ docker run -d --name sonarqube -p 80:8080 -p 443:8443 \
@@ -300,11 +289,11 @@ This would be an example of SMTP configuration using a Gmail account:
bitnami/sonarqube:latest
```
##### Connect SonarQube&trade; container to an existing database
#### Connect SonarQube&trade; container to an existing database
The Bitnami SonarQube&trade; container supports connecting the SonarQube&trade; application to an external database. This would be an example of using an external database for SonarQube&trade;.
- Modify the [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/sonarqube/docker-compose.yml) file present in this repository:
* Modify the [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/sonarqube/docker-compose.yml) file present in this repository:
```diff
sonarqube:
@@ -320,7 +309,7 @@ The Bitnami SonarQube&trade; container supports connecting the SonarQube&trade;
...
```
- For manual execution:
* For manual execution:
```console
$ docker run -d --name sonarqube\
@@ -448,10 +437,10 @@ docker-compose up -d
### 9.0.0-debian-10-r0
- The size of the container image has been decreased.
- The configuration logic is now based on Bash scripts in the *rootfs/* folder.
- The SonarQube&trade; container image has been migrated to a "non-root" user approach. Previously the container ran as the `root` user and the SonarQube&trade; daemon was started as the `sonarqube` user. From now on, both the container and the SonarQube&trade; daemon run as user `1001`. You can revert this behavior by changing `USER 1001` to `USER root` in the Dockerfile, or `user: root` in `docker-compose.yml`. Consequences:
- Backwards compatibility is not guaranteed when data is persisted using docker or docker-compose. We highly recommend migrating the SonarQube&trade; site by exporting its content, and importing it on a new SonarQube&trade; container. Follow the steps in [Backing up your container](#backing-up-your-container) and [Restoring a backup](#restoring-a-backup) to migrate the data between the old and new container.
* The size of the container image has been decreased.
* The configuration logic is now based on Bash scripts in the *rootfs/* folder.
* The SonarQube&trade; container image has been migrated to a "non-root" user approach. Previously the container ran as the `root` user and the SonarQube&trade; daemon was started as the `sonarqube` user. From now on, both the container and the SonarQube&trade; daemon run as user `1001`. You can revert this behavior by changing `USER 1001` to `USER root` in the Dockerfile, or `user: root` in `docker-compose.yml`. Consequences:
* Backwards compatibility is not guaranteed when data is persisted using docker or docker-compose. We highly recommend migrating the SonarQube&trade; site by exporting its content, and importing it on a new SonarQube&trade; container. Follow the steps in [Backing up your container](#backing-up-your-container) and [Restoring a backup](#restoring-a-backup) to migrate the data between the old and new container.
## Contributing