目录
[root@junmo jenkins]
.
├── data
├── jenkins.yml
└── passwd.txt1 directory, 2 files
[root@junmo jenkins]
docker-compose.yml
version: '3.1'
services:jenkins:image: jenkins/jenkins:ltsrestart: alwayshostname: jenkinscontainer_name: jenkinsprivileged: true user: rootports:- 10080:8080- 50000:50000environment:TZ: Asia/Shanghaivolumes:- ./data:/var/jenkins_home - /opt/softs/maven/maven3.8:/usr/local/maven - /opt/softs/java/jdk8:/usr/local/jdk1.8.0_261 - /var/run/docker.sock:/var/run/docker.sock - /usr/bin/docker:/usr/bin/docker
启动
docker-compose -f jenkins.yml up -d
docker-compose -f jenkins.yml down
docker-compose -f jenkins.yml restart
docker安装jenkins
docker run -d --user=root \
--restart=always --privileged=true \
--name jenkins -p 10080:8080 -p 50000:50000 \
-v /opt/jenkins/data:/var/jenkins_home \
-v /opt/soft/maven/maven3.8:/usr/local/maven \
-v /opt/soft/jdk/jdk8:/usr/local/jdk1.8.0_261 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /usr/bin/docker:/usr/bin/docker \
jenkins/jenkins