由于低版本的安装插件很麻烦,插件版本依赖很坑,所以选择了安装最新版 Jenkins,并使用 docker 安装
# https://www.jenkins.io/zh/doc/book/installing/#docker
[root@localhost ~]# docker run \
-u root \
-d \
-p 8888:8080 \
-p 50000:50000 \
-v jenkins-data:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
jenkinsci/blueocean
Unable to find image 'jenkinsci/blueocean:latest' locally
latest: Pulling from jenkinsci/blueocean
97518928ae5f: Pull complete
f4d84728e541: Pull complete
419d112ff4fa: Pull complete
ecf8c1881f75: Pull complete
78b59c3bfdb7: Pull complete
2ff43df4e763: Pull complete
aac7818be7cc: Pull complete
2913a3e94ae4: Pull complete
f75b1dac4ec0: Pull complete
3d3fbe6f1850: Pull complete
07ef919d711b: Pull complete
5b96e9c30f6a: Pull complete
83dcd37be04b: Pull complete
6beb8929489c: Pull complete
476e95021232: Pull complete
9add339bd1dd: Pull complete
ecb71d48971e: Extracting [==========================================> ] 68.52MB/79.82MB
384cd4783059: Downloading [========================> ] 39.37MB/80.01MB
latest: Pulling from jenkinsci/blueocean
213ec9aee27d: Pull complete
9fb6b045bfc8: Pull complete
1a7d7223e42d: Pull complete
8f2b061b68da: Pull complete
bba48a821480: Pull complete
0061c72f26bd: Pull complete
f65ed3fbea93: Pull complete
3509f53c6b7b: Pull complete
28ea9c56d127: Pull complete
b3b3ea5ca7f4: Pull complete
e5ecc395b9e7: Pull complete
a4cea1bad4ff: Pull complete
d2d0e6e9298c: Pull complete
f786c314ed83: Pull complete
Digest: sha256:f27933313986f7fb0b5784aa6520ebddc455ce258cbf4d13a3e3cf9d4c94d992
Status: Downloaded newer image for jenkinsci/blueocean:latest
ed7e01366751745a454f939744f0e14a20dd9956b3d1852e44244d5ca32d3693
[root@localhost ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ed7e01366751 jenkinsci/blueocean "/sbin/tini -- /usr/…" 3 minutes ago Up 2 minutes 0.0.0.0:50000->50000/tcp, :::50000->50000/tcp, 0.0.0.0:8888->8080/tcp, :::8888->8080/tcp heuristic_sinoussi
[root@localhost ~]#
# 查看登录码
[root@localhost ~]# docker exec -it ed7e /bin/bash
bash-5.1# cat /var/jenkins_home/secrets/initialAdminPassword
ea870d38fd2345344918f55f89c29d8c1
bash-5.1#
修改 admin 密码
滚动页面,找到密码处,输入新密码
保存后会退出重新登录
插件安装
配置国内源:http://mirror.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
安装汉化插件:Localization: Chinese