version: '3.3'
services:
jenkins:
image: jenkins/jenkins:lts
restart: unless-stopped
privileged: true
user: root
ports:
- 8080:8080
container_name: jenkins
volumes:
- ./jenkins:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
- /usr/local/bin/docker:usr:/usr/local/bin/docker
docker-compose up -d 運行 jenkins
docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword