docker-compose 文件
docker-compose.yml
version: '3.7'
services:
jenkins:
image: jenkins/jenkins:lts
restart: always
privileged: true
user: root
ports:
- 18080:8080
- 50000:50000
container_name: jenkins
volumes:
- ./data/jenkins:/var/jenkins_home
- ./data/docker.sock:/var/run/docker.sock
- ./data/bin/docker:/usr/local/bin/docker
启动
docker-compose up -d
docker logs 容器名