echo "启动2个docker 实例."
[root@nexus postgres]# more start-postgres-docker.sh #!/usr/bin/env bash
firewall-cmd --add-port=5432/tcp --permanent firewall-cmd --reload
docker stop postgres-for-sonarqube docker rm postgres-for-sonarqube
docker run -d
--restart always
--name postgres-for-sonarqube
-p 5432:5432
-v pwd/pgdata:/var/lib/postgresql/data
-e "POSTGRES_USER=postgres"
-e "POSTGRES_PASSWORD=your_password"
-e "POSTGRES_DB=sonarqube"
postgres:9.6.12-alpine
#more start-sonarqube-docker.sh #!/usr/bin/env bash
firewall-cmd --add-port=9000/tcp --permanent firewall-cmd --reload
#下面的IP改成你的IP地址 host_ip="192.168.2.40"
docker run -d
--restart always
--name sonarqube
-v pwd/plugins:/opt/sonarqube/extensions/plugins
--add-host "postgres.tools.devops.marathon.mesos:${host_ip}"
-e "sonar.jdbc.username=postgres"
-e "sonar.jdbc.password=your_password"
-e "TZ=Asia/Shanghai"
-e "sonar.jdbc.url=jdbc:postgresql://${host_ip}:5432/sonarqube"
-p 9000:9000
ascs/sonarqube:7.9.1-community-zh
Content type
Image
Digest
Size
422.2 MB
Last updated
over 7 years ago
docker pull ascs/sonarqube