惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
阮一峰的网络日志
阮一峰的网络日志
C
Check Point Blog
Stack Overflow Blog
Stack Overflow Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
M
MIT News - Artificial intelligence
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
WordPress大学
WordPress大学
博客园_首页
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Visual Studio Blog
L
LINUX DO - 最新话题
S
Security @ Cisco Blogs
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
The GitHub Blog
The GitHub Blog
Schneier on Security
Schneier on Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
Jina AI
Jina AI
雷峰网
雷峰网
罗磊的独立博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 【当耐特】
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
人人都是产品经理
人人都是产品经理
Microsoft Security Blog
Microsoft Security Blog
V
V2EX
N
News and Events Feed by Topic
V2EX - 技术
V2EX - 技术
宝玉的分享
宝玉的分享
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
P
Proofpoint News Feed
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
O
OpenAI News
P
Proofpoint News Feed
H
Help Net Security
S
Securelist
Vercel News
Vercel News
Hacker News: Ask HN
Hacker News: Ask HN
博客园 - 三生石上(FineUI控件)

jobcher on 打工人日志

2023-12-21 打工人日报 2023-12-20 打工人日报 2023-12-19 打工人日报 2023-12-18 打工人日报 2023-12-17 打工人日报 2023-12-16 打工人日报 2023-12-15 打工人日报 2023-12-14 打工人日报 2023-12-13 打工人日报 2023-12-12 打工人日报 2023-12-11 打工人日报 2023-12-10 打工人日报 2023-12-09 打工人日报 2023-12-08 打工人日报 2023-12-07 打工人日报 2023-12-06 打工人日报 2023-12-05 打工人日报 2023-12-04 打工人日报 2023-12-03 打工人日报 2023-12-02 打工人日报 2023-12-01 打工人日报 2023-11-30 打工人日报 2023-11-29 打工人日报 2023-11-28 打工人日报 2023-11-27 打工人日报 2023-11-26 打工人日报 2023-11-25 打工人日报 2023-11-24 打工人日报 2023-11-23 打工人日报 2023-11-22 打工人日报 2023-11-21 打工人日报 2023-11-20 打工人日报 2023-11-19 打工人日报 2023-11-17 打工人日报 2023-11-16 打工人日报 2023-11-15 打工人日报 2023-11-14 打工人日报 2023-11-13 打工人日报 2023-11-12 打工人日报 2023-11-11 打工人日报 2023-11-10 打工人日报 2023-11-09 打工人日报 2023-11-08 打工人日报 2023-11-07 打工人日报 2023-11-06 打工人日报 2023-11-05 打工人日报 2023-11-04 打工人日报 2023-11-03 打工人日报 2023-11-02 打工人日报 2023-11-01 打工人日报 2023-10-31 打工人日报 2023-10-30 打工人日报 2023-10-29 打工人日报 2023-10-28 打工人日报 2023-10-27 打工人日报 2023-10-26 打工人日报 2023-10-25 打工人日报 2023-10-24 打工人日报 2023-10-23 打工人日报 2023-10-22 打工人日报 2023-10-21 打工人日报 2023-10-20 打工人日报 2023-10-19 打工人日报 2023-10-18 打工人日报 2023-10-17 打工人日报 2023-10-16 打工人日报 2023-10-15 打工人日报 2023-10-14 打工人日报 2023-10-13 打工人日报 2023-10-12 打工人日报 2023-10-11 打工人日报 2023-10-10 打工人日报 2023-10-09 打工人日报 2023-10-07 打工人日报 2023-10-06 打工人日报 2023-10-05 打工人日报 2023-10-04 打工人日报 2023-10-03 打工人日报 2023-10-02 打工人日报 2023-10-01 打工人日报 2023-09-30 打工人日报 2023-09-29 打工人日报 2023-09-28 打工人日报 2023-09-27 打工人日报 2023-09-26 打工人日报 2023-09-25 打工人日报 2023-09-24 打工人日报 2023-09-23 打工人日报 2023-09-22 打工人日报 2023-09-21 打工人日报 2023-09-20 打工人日报 2023-09-19 打工人日报 2023-09-18 打工人日报 2023-09-17 打工人日报 2023-09-16 打工人日报 2023-09-15 打工人日报 2023-09-14 打工人日报 2023-09-13 打工人日报 2023-09-12 打工人日报 2023-09-11 打工人日报
sonarqube docker安装和配置
2023-11-02 · via jobcher on 打工人日志

背景

我是在ubuntu服务器安装docker服务,我已经安装好了docker和docker-compose服务,这里我就不写这些服务的安装过程,直接开始安装sonarqube服务

安装 sonarqube服务器

1.执行脚本文件 config.sh

1#!/bin/bash
2sysctl -w vm.max_map_count=262144
3sysctl -w fs.file-max=65536
4ulimit -n 65536
5ulimit -u 4096
6# # 永久改变
7# echo "vm.max_map_count=262144" >> /etc/sysctl.conf
8# sysctl -p

2.执行docker-compose文件

 1version: '3'
 2services:
 3  postgres:
 4    image: postgres:15
 5    container_name: postgres
 6    ports:
 7      - 5432:5432
 8    volumes:
 9      - ./sonar/postgres/postgresql:/var/lib/postgresql
10      - ./sonar/postgres/data:/var/lib/postgresql/data
11    environment:
12      TZ: Asia/Shanghai
13      POSTGRES_USER: user #数据库用户
14      POSTGRES_PASSWORD: password #数据库密码
15      POSTGRES_DB: sonar
16
17  sonarqube:
18    depends_on:
19      - postgres
20    image: sonarqube:9.9.0-community
21    container_name: sonarqube
22    ports:
23      - 9000:9000
24    volumes:
25      - ./sonar/sonarqube/extensions:/opt/sonarqube/extensions
26      - ./sonar/sonarqube/logs:/opt/sonarqube/logs
27      - ./sonar/sonarqube/data:/opt/sonarqube/data
28      - ./sonar/sonarqube/conf:/opt/sonarqube/conf
29    environment:
30      SONARQUBE_JDBC_USERNAME: user #数据库用户
31      SONARQUBE_JDBC_PASSWORD: password #数据库密码
32      SONARQUBE_JDBC_URL: jdbc:postgresql://postgres:5432/sonar

3. 生成用户令牌

1698896646032.jpg

安装 sonar scanner扫描器

1wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip
2unzip sonar-scanner-cli-5.0.1.3006-linux.zip
3mv sonar-scanner-cli-5.0.1.3006-linux.zip /opt/

连接sonarqube服务器

1cd /opt/sonar-scanner-5.0.1.3006-linux/conf/
2vim sonar-scanner.properties

修改配置文件

1#No information about specific project should appear here
2
3#----- 修改服务器地址
4sonar.host.url=http://sonar-server:9000
5
6#----- Default source code encoding
7sonar.sourceEncoding=UTF-8

安装scanner

1cd sonar-scanner-5.0.1.3006-linux/
2sudo ln -s /opt/sonar-scanner-5.0.1.3006-linux/bin/sonar-scanner /usr/local/bin/sonar-scanner
3sonar-scanner -v

执行扫描

1cd /code/github/project/path
2sonar-scanner -D sonar.login=<sonar-key> -Dsonar.projectKey=<my-project> -Dsonar.projectName=<my-project-name> -Dsonar.projectVersion=1.0 -Dsonar.sourceEncoding=UTF-8 -Dsonar.java.binaries=target/classes -Dsonar.java.libraries=target/*.jar

在sonarsever上查看

1698896917631.jpg