帮你做codereview:使用docker安装sonarqube并扫描你的.net core元源码 dock拉取sonarqube 获取postgre 创建postgre容器 创建sonarqube 登录并修改密码 错误解决 进入市场,安装Chinaese pack进行汉化 运行代码检查 效果展示

docker pull sonarqube

获取postgre

docker pull postgres

创建postgre容器

docker run --name postgresql -e POSTGRES_USER=sonar -e POSTGRES_PASSWORD={数据库密码} -p 5432:5432 -v /data/postgresql/data:/var/lib/postgresql/data -d postgres:12.3-alpine

创建sonarqube

##创建sonarqube容器
docker run -d --name sonarqube    --link postgresql     -p 9000:9000     -e sonar.jdbc.url=jdbc:postgresql://postgresql:5432/sonar     -e sonar.jdbc.username=sonar     -e sonar.jdbc.password=123456     -v /data/sonarqube/sonarqube_extensions:/opt/sonarqube/extensions     -v /data/sonarqube/sonarqube_logs:/opt/sonarqube/logs     -v /data/sonarqube/sonarqube_data:/opt/sonarqube/data     sonarqube
    

登录并修改密码

http://192.168.114.131:9000/projects

默认用户名密码 admin/admin

修改为admin/123456

错误解决

ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
bootstrap check failure [1] of [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决方案:

https://blog.csdn.net/u011110301/article/details/108650404

进入市场,安装Chinaese pack进行汉化

运行代码检查

创建令牌

oms: a22aa04923b4a004e1c9738d604eea3ab4c39ac2

扫描.netcore项目

安装扫描工具

dotnet tool install --global dotnet-sonarscanner

帮你做codereview:使用docker安装sonarqube并扫描你的.net core元源码
dock拉取sonarqube
获取postgre
创建postgre容器
创建sonarqube
登录并修改密码
错误解决
进入市场,安装Chinaese pack进行汉化
运行代码检查
效果展示

执行扫描脚本

本地要先安装jdk

dotnet sonarscanner begin /k:"oms" /d:sonar.host.url="http://192.168.114.131:9000" /d:sonar.login="a22aa04923b4a004e1c9738d604eea3ab4c39ac2"

帮你做codereview:使用docker安装sonarqube并扫描你的.net core元源码
dock拉取sonarqube
获取postgre
创建postgre容器
创建sonarqube
登录并修改密码
错误解决
进入市场,安装Chinaese pack进行汉化
运行代码检查
效果展示

dotnet build

dotnet sonarscanner end /d:sonar.login="a22aa04923b4a004e1c9738d604eea3ab4c39ac2"

帮你做codereview:使用docker安装sonarqube并扫描你的.net core元源码
dock拉取sonarqube
获取postgre
创建postgre容器
创建sonarqube
登录并修改密码
错误解决
进入市场,安装Chinaese pack进行汉化
运行代码检查
效果展示

效果展示

帮你做codereview:使用docker安装sonarqube并扫描你的.net core元源码
dock拉取sonarqube
获取postgre
创建postgre容器
创建sonarqube
登录并修改密码
错误解决
进入市场,安装Chinaese pack进行汉化
运行代码检查
效果展示

帮你做codereview:使用docker安装sonarqube并扫描你的.net core元源码
dock拉取sonarqube
获取postgre
创建postgre容器
创建sonarqube
登录并修改密码
错误解决
进入市场,安装Chinaese pack进行汉化
运行代码检查
效果展示

帮你做codereview:使用docker安装sonarqube并扫描你的.net core元源码
dock拉取sonarqube
获取postgre
创建postgre容器
创建sonarqube
登录并修改密码
错误解决
进入市场,安装Chinaese pack进行汉化
运行代码检查
效果展示