当前位置:网站首页>Docker builds sonarqube, mysql5.7 environment
Docker builds sonarqube, mysql5.7 environment
2022-07-24 00:10:00 【cristianoxm】
One 、 brief introduction
SonarQube: Is an open source code detection tool . This article introduces through docker To install . The general operation process is like this , Through the first sonar-scanner Plug in scanning code , Store data in a database ,sonarQube Read database , Show the database in web platform .
Two 、 install mysql rely on
Be careful ,sonarqube I won't support it mysql8 Version database , And in 7.8 Discard after version mysql Support for
- docker install mysql5.7
1.pull Mirror image
docker pull mysql:5.7
2. Create a directory to mount
mkdir -p /data/mysql5.7/{
conf,log,data}
3. Increase authority
chmod -R 777 /data/mysql5.7
4. stay conf Create my.conf, The contents are as follows :
[mysqld]
user=mysql
character-set-server=utf8
default_authentication_plugin=mysql_native_password
secure_file_priv=/var/lib/mysql
expire_logs_days=7
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
max_connections=1000
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
5.docker start-up mysql5.7
docker run --restart=always --privileged=true -v /data/mysql5.7/data/:/var/lib/mysql -v /data/mysql5.7/conf/my.cnf:/etc/mysql/my.cnf -v /data/mysql5.7/log:/var/log/mysql -d -p 63306:6306 -e MYSQL_USER="cxm" -e MYSQL_PASSWORD="cxm" -e MYSQL_ROOT_PASSWORD="cxm" --name mysql_sonarqube mysql:5.7
6. Get into mysql5.7, promote cxm User's rights
mysql>grant all privileges on db_name.* to [email protected]'%' identified by 'db_password';
mysql>flush privileges;
3、 ... and 、docker start-up sonarqube
- Pull the mirror image
docker pull sonarqube:7.7-community
- Create a working directory
mkdir -p /data/sonarqube
- Run container
docker run -d --name sonartest sonarqube:7.7-community
- Copy important files in the container to the host
docker cp sonartest:/opt/sonarqube/conf /data/sonarqube
docker cp sonartest:/opt/sonarqube/data /data/sonarqube
docker cp sonartest:/opt/sonarqube/logs /data/sonarqube
docker cp sonartest:/opt/sonarqube/extensions /data/sonarqube
- Delete container
docker rm sonartest
- Modify folder permissions
chmod -R 777 /data/sonarqube/
- Create the container and run it
docker run -d --privileged=true --name sonar -p 9001:9000 \
-e ALLOW_EMPTY_PASSWORD=yes \
-e "SONARQUBE_JDBC_URL=jdbc:mysql://172.17.0.3:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false" \
-e "SONARQUBE_JDBC_USERNAME=cxm" \
-e "SONARQUBE_JDBC_PASSWORD=cxm" \
-v /data/sonarqube/logs:/opt/sonarqube/logs \
-v /data/sonarqube/conf:/opt/sonarqube/conf \
-v /data/sonarqube/data:/opt/sonarqube/data \
-v /data/sonarqube/extensions:/opt/sonarqube/extensions\
sonarqube:7.7-community
- Get into sonarqubeyemian
- The default user :admin
- Default password :admin
- Install Chinese plug-in
Plug in download address :https://github.com/xuhuisheng/sonar-l10n-zh/releases/tag/sonar-l10n-zh-plugin-1.27
Go directly to the mount directory /data/sonarqube/extensions/plugins
function : wget https://github.com/xuhuisheng/sonar-l10n-zh/releases/download/sonar-l10n-zh-plugin-1.27/sonar-l10n-zh-plugin-1.27.jar
restart sonarqube take effect
边栏推荐
- Deep learning 9 basic concepts of feedforward neural networks
- 蓝绿部署、金丝雀发布、A/B测试是什么
- Why do most people think programming is difficult?
- logback
- The QT creation window is blocked and cannot be displayed in time
- 【微信小程序】拍卖商品详情页设计与交互实现(包含倒计时、实时更新出价)
- My meeting of OA project (query)
- 【译】Go RPC 入门:Hello World
- YOLOv1
- Lac automatic dialing experiment of L2TP
猜你喜欢
![[opencv] - when the parameter type of cv.threshold() function is a number, what does it mean](/img/7c/be8049ece7f109b44d361c32cf2da8.png)
[opencv] - when the parameter type of cv.threshold() function is a number, what does it mean

Intel Intel realsense realistic depth camera self calibration operation steps explanation D400 series is applicable
C语言详解系列——函数的认识(2)如何使用函数实现交换两个整型变量的值

Splicing of.Net distribution with outlook mail format and table
![[translation] Introduction to go RPC: Hello World](/img/dd/7887f056bc031fe50253078dd355d0.png)
[translation] Introduction to go RPC: Hello World

Linked list - 707. Design linked list

YOLOv1

Error handling of DGS

Deep learning 9 feedforward neural network 2: realize feedforward neural network and model optimization

QT create a background mask, pop up the child window, and the background of the parent window turns black and dark
随机推荐
Nacos
总结谋划明方向 凝心聚力开新局——和数软件对口援疆项目显成效
浏览器无法访问minio
多表查询之_外连接
权重分析——CRITIC权重法
什么是 Restful 动词
L2TP的LAC自动拨号实验
Lac automatic dialing experiment of L2TP
【微服务架构】分布式事务
kubernetes error
怎么开户买收益6%的理财产品呢?
Splicing of.Net distribution with outlook mail format and table
加密技术应用
N+1 selection of DGS
What is restful verb
今天在家里补觉
文本和图片的绘制、数据存储、localStorage、sessionStorage、cookie三者的区别
YOLOv1
链表——206. 反转链表(这题很重要)
Super simple training of force deduction and problem brushing
