菜单
一、docker安装Sonar Service
1.1 安装docker和docker-compose
1.2 编写docker-compose.yml
version: "3"
services:
sonarqube:
image: sonarqube:9.5.0-community
networks:
- sonarnet
depends_on:
- db
environment:
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonarqube
SONAR_JDBC_USERNAME: sonar
SONAR_JDBC_PASSWORD: sonar
SONAR_SEARCH_JAVAOPTS: -Xms256m -Xmx256m
volumes:
- /data/app/sonarqube:/opt/sonarqube/data
- /data/app/sonarqube/extensions:/opt/sonarqube/extensions
- /data/app/sonarqube/logs:/opt/sonarqube/logs
ports:
- "9010:9000"
- "9011:9092"
db:
image: postgres:12
networks:
- sonarnet
environment:
POSTGRES_USER: sonar
POSTGRES_PASSWORD: sonar
POSTGRES_DB: sonarqube
volumes:
- /data/app/postgresql:/var/lib/postgresql
- /data/app/postgresql/data:/var/lib/postgresql/data
networks:
sonarnet:
driver: bridge
1.3修改系统配置
shell>vim /etc/sysctl.conf
####追加内容vm.max_map_count=262144
[root@rancher app]# cat /etc/sysctl.conf
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
#
vm.max_map_count=262144
#####执行环境变量
shell>systemctl -p
1.4 执行docker-compose
[root@rancher app]# docker-compose -f sonarqube-docker-compose.yml up
1.5 查看容器状态
[root@rancher app]# docker-compose -f sonarqube-docker-compose.yml ps
1.6 登录系统
输入地址:http://ip:9010/,默认账号密码是:admin/admin
二、sonarQube汉化
汉化完成