版本说明
省略 docker 安装过程
docker version
1 | Client: |
java -version
1 | java version "1.8.0_131" |
安装 Jenkins 镜像
1 | docker pull jenkins/jenkins:2.138.1-slim |
拉取的是 2.138.1-slim 版本的 jenkins,可通过命令查看下载的版本
docker images
1 | REPOSITORY TAG IMAGE ID CREATED SIZE |
启动 Jenkins
1 | docker run -d -p 8002:8080 -v ~/jenkins:/var/jenkins_home -v /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home:/mnt/java -v /usr/local/Cellar/maven/3.6.1:/mnt/maven --name jenkins --restart=always jenkins/jenkins:2.138 |
8002:8080
本地 8002 端口映射容器 8080 端口
查看启动日志 docker logs -f jenkins
可以看到jenkins
的默认admin
密码
1 | Jenkins initial setup is required. An admin user has been created and a password generated. |
界面访问127.0.0.1:8002
,自动跳转至登录界面,首次进线输入默认密码,登录后安装推荐插件。
jenkins 插件镜像
页面依次点击/Manage Jenkins/Manage Plugins/Advanced 镜像地址:
1 | https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json |