以Docker方式启动SonarQube
拉取镜像
docker pull postgres:13
docker pull sonarqube:8.9-community
运行容器
启动postgres
docker run \
-d \
--name postgres \
-p 5432:5432 \
-e POSTGRES_USER=sonar \
-e POSTGRES_PASSWORD=sonar \
postgres:13
启动SonarQube
docker run \
-d \
--name sonarqube \
-p 9000:9000 \
--link postgres \
-e SONARQUBE_JDBC_URL=jdbc:postgresql://192.168.0.206:5432/sonar \
-e SONARQUBE_JDBC_USERNAME=sonar \
-e SONARQUBE_JDBC_PASSWORD=sonar \
sonarqube:8.9-community
查看状态
[root@centos ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
74b8f43ec7b4 sonarqube:9.9.1-community "/opt/sonarqube/dock…" 13 minutes ago Up 13 minutes 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp sonarqube
9131f24c4b49 postgres:15-alpine "docker-entrypoint.s…" 36 minutes ago Up 36 minutes 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp postgres
报错和汉化 看另一篇博客
https://www.cnblogs.com/scfssq/p/17425582.html