爱生活、爱运动、爱分享、爱折腾、爱编程。

docker+Jenkins自动构建部署

1、拉取Jenkins镜像 (默认拉取最新的镜像)5.0.5
需要其它版本在后面加:tag(版本)

docker pull jenkins

2、在宿主机上建立Jenkins挂载目录: 

mkdir /usr/local/jenkins
chmod 777 /usr/local/jenkins
docker run -d --name jenkins -p 8080:8080 -p 50000:50000 -v /usr/local/jenkins:/var/jenkins_home jenkins

接下来访问 ip:8080,安装
密码会在输出终端,也可根据页面提示到容器的jenkins_home中查找。

docker logs jenkins

INFO:
*************************************************************
*************************************************************
*************************************************************
Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:
xxxxxxx这里密码复制过去
This may also be found at: /var/jenkins_home/secrets/initialAdminPassword

参考官网 https://jenkins.io/zh/doc/book/installing/

赞(0)
(转载本站文章请注明作者和出处 ,请勿用于任何商业用途)Mydrn爱生活爱分享 » docker+Jenkins自动构建部署

评论 抢沙发

评论前必须登录!