jenkins-lts
with Ansible
mkdir -p /srv/docker/jenkins
#处理用户映射
chown -R 1000:1000 /srv/docker/jenkins
#基于docker unix socket共享
docker run -d --name jk \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(which docker):/usr/bin/docker \
-v /srv/docker/jenkins:/var/jenkins_home \
-v /lib64/libsystemd-journal.so.0:/usr/lib/libsystemd-journal.so.0 \
-v /lib64/libsystemd-id128.so.0:/usr/lib/libsystemd-id128.so.0 \
-v /lib64/libdevmapper.so.1.02:/usr/lib/libdevmapper.so.1.02 \
-v /lib64/libgcrypt.so.11:/usr/lib/libgcrypt.so.11 \
-v /lib64/libdw.so.1:/usr/lib/libdw.so.1 \
-v /lib64/libltdl.so.7:/usr/lib/libltdl.so.7 \
-e JAVA_OPTS=-Duser.timezone=Asia/Shanghai \ #默认UTC时区
-p 8080:8080 eswork/jenkins:lts
在jenkins容器上可以使用sudo docker images
命令访问宿主机docker
docker exec -it jk sudo docker images