docker-compose jenkins安装(二)
jenkins 版本规则:https://www.jenkins.io/zh/download/
jenkins 官方镜像下载地址:https://hub.docker.com/r/jenkins/jenkins
jenkins 捆绑Blue Ocean的镜像下载地址:https://hub.docker.com/r/jenkinsci/blueocean
jenkins 安装文档地址:https://www.jenkins.io/zh/doc/book/installing/
docker-compose 安装 jenkins
docker-compose.yml 文件
version: '3.7'
services:
jenkins:
container_name: jenkins
image: 'jenkins/jenkins:2.346.3-2-lts-jdk11'
user: root
restart: always
environment:
- TZ=Asia/Shanghai
ports:
- '8080:8080'
- '50000:50000'
volumes:
- ./jenkins_home:/var/jenkins_home
- /usr/bin/docker:/usr/bin/docker
- /var/run/docker.sock:/var/run/docker.sock
- /etc/docker/daemon.json:/etc/docker/daemon.json
#############################################################
# ./jenkins_home:/var/jenkins_home/ 这是把容器内的目录映射到宿主机
# 由于jenkins是使用docker容器安装的,后续我要通过jenkins进行docker镜像打包并推送到docker镜像仓库时,
# 需要使用docker命令,所以需要把宿主机的docker环境映射到jenkins容器内,需要做如下配置
#############################################################
启动:docker-compose up -d
查看初始密码:docker logs -f jenkins
首次登陆:http://ip:8080
**** 好看的皮囊千篇一律,有趣的灵魂万里挑一 **** 好评点赞 !!!!!!!!!!!!!!!!!!!!!!!!!!!