version: '3' services: docker_jenkins: restart: always image: jenkins/jenkins:lts container_name: docker_jenkins #privileged: true #container内的root拥有真正的root权限(宿主机的root权限) user: root #以root身份启动 不想设置/data/jenkins目录权限 ports: - '8080:8080' - '50000:50000' volumes: - /data/jenkins:/var/jenkins_home - /var/run/docker.sock:/var/run/docker.sock - /usr/bin/docker:/usr/bin/docker - /usr/lib/x86_64-linux-gnu/libltdl.so.7:/usr/lib/x86_64-linux-gnu/libltdl.so.7