Docker Compose安装jenkins
2021-10-27 本文已影响0人
请叫我比比比巴卜
创建docker-compose文件,docker-compose-jenkins.yml
version: '2'
services:
jenkins:
image: 'jenkinsci/blueocean'
container_name: jenkins
privileged: true
restart: always
ports:
- '3389:8080'
- '50000:50000'
volumes:
- '/root/jenkins/jenkins_home:/var/jenkins_home'
restart: always
mem_limits: 2G
创建jenkins_home文件夹,并且添加权限
chown -R 1000:1000 /root/jenkins/jenkins_home
启动jenkins
docker-compose -f docker-compose-jenkins.yml up -d
查看初始化密码
cat /root/jenkins/jenkins_home/secrets/initialAdminPassword