Skip to content

2023

Run Sonarqube In Docker

  1. Start a Postgres Docker

    It needs to set the hostname for the Postgres Docker, so that the Sonarqube docker can connect it via hostname.

    Bash
    docker run --name postgres --hostname postgres -e POSTGRES_USER=<pg user> -e POSTGRES_PASSWORD=<pg password> \
      -e PGDATA=/var/lib/postgresql/data/pgdata  -e POSTGRES_HOST_AUTH_METHOD=scram-sha-256  \
      -v "$(pwd)/data":/var/lib/postgresql/data -p 5432:5432 -d --restart always postgres:alpine