关闭 selinux
# 临时关闭
$ setenforce 0
# 永久关闭,重启机器
$ vim /etc/selinux/config

image.png
拉取jenkins中文社区镜像
$ docker pull jenkinszh/jenkins-zh:latest
运行jenkins容器
$ docker run -d -u 0 -p 8082:8080 -v /data/jenkins:/var/jenkins_home --name jenkins --restart=always jenkinszh/jenkins-zh:latest
查看jenkins容器
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3e4443ee5559 jenkins "/bin/tini -- /usr..." 4 seconds ago Up 3 seconds 50000/tcp, 0.0.0.0:8082->8080/tcp jenkins
访问
http://ip:8082/
如果出现下图

image.png
修改 hudson.model.UpdateCenter.xml 中的 url
$ vim /data/jenkins/hudson.model.UpdateCenter.xml

image.png
执行容器内命令查看密码
$ docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword

image.png
安装推荐插件

image.png

image.png

image.png
JDK安装
# 进入容器 找到 JAVA_HOME 路径
$ docker exec -it jenkins /bin/bash

image.png

image.png
Maven选择自动安装即可

image.png
插件的安装使用

image.png
搜索安装 Maven、SSH 插件

image.png

image.png
网友评论