docker 安装 Jenkins
#拉镜像
docker pull jenkins/jenkins
#创建卷(volume)
docker volume create jenkins_home
#制作容器并启动
docker run -d \
-p 8080:8080 \
-p 50000:50000 \
-v jenkins_home:/var/jenkins_home \
-v /usr/lib/jvm/java-8-openjdk-amd64:/usr/local/java \
-v /home/holen/.local/share/apache-maven-3.6.3:/usr/local/maven \
--name jenkins-quick \
jenkins/jenkins
#访问Jenkins
http://localhost:8080
配置Jenkins
1、设置Jenkins插件镜像源
#查看jenkins_home
docker volume inspect jenkins_home
#给访问权限
sudo chmod 777 /var/lib/docker/
sudo chmod 777 /var/lib/docker/volumes/
#进入配置文件目录
cd /var/lib/docker/volumes/jenkins_home/_data/updates
#替换源为清华源
sed -i 's/updates.jenkins.io\/download/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' default.json && sed -i 's/www.google.com/www.baidu.com/g' default.json
#系统设置 -> 插件设置 -> 高级设置
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
文章来源地址https://uudwc.com/A/mo1Bk
2、启动配置
3、插件配置
4、配置Gitee
https://gitee.com/profile/personal_access_tokenshttps://gitee.com/profile/personal_access_tokens
5、配置maven
6、配置JDK
文章来源:https://uudwc.com/A/mo1Bk