当前位置:网站首页>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
边栏推荐
- 云原生的概念
- DGS first acquaintance
- Ubtun update source
- Operating system not found solution after importing ISO into virtual machine
- 单目标追踪——【相关滤波】MOSSE:Visual Object Tracking using Adaptive Correlation Filters
- FPGA - SPI bus control flash (3) including code
- 合宙ESP32C3基于Arduino IDE框架下配置分区表
- Copy the customer service wechat, go to wechat to add, and make a call
- Chapter 6: implement a persistence adapter
- 【微信支付】
猜你喜欢
随机推荐
Automatic escape processing in JMeter
[hcip] OSPF experiment under mGRE environment, including multi process bidirectional republication and OSPF special area
Chapter 6: implement a persistence adapter
Nacos
logback
Summarize the plan, clarify the direction, concentrate and start a new situation -- the Counterpart Assistance Project of hexu software has achieved remarkable results
vulnhub wpwn: 1
Data driven excel reading and writing
Application of encryption technology
Tencent will close the "magic core". Is there any resistance to the development of digital collections?
Code generation of DGS
day2
Qt | 设置部件大小 sizeHint、minimumSizeHint、sizePolicy、stretch factor
太空射击 第07课: 添加图形
Linked list - 707. Design linked list
Lac automatic dialing experiment of L2TP
PyTorch 中遇到的问题
【译】Go RPC 入门:Hello World
pytorch中with torch.no_grad(): && model.eval()
云原生的概念









