jenkins循序渐进
docker安装
cat >docker-compose.yml <<EOF
version: "3.6"
services:
jenkins:
user: root
restart: always
#image: jenkins/jenkins:lts
image: jenkins_rsync:tls
container_name: jenkins
ports:
- 18080:8080
- 50000:50000
volumes:
- ./jenkins_home/:/var/jenkins_home/
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
- /root/.ssh:/root/.ssh
- /etc/docker/daemon.json:/etc/docker/daemon.json
- /etc/localtime:/etc/localtime
EOF
镜像制作
jenkins-rsync
Dockerfile
cat >Dockerfile <<EOF
FROM jenkins/jenkins:lts
USER root
RUN sed -i 's#http://deb.debian.org#https://mirrors.163.com#g' /etc/apt/sources.list.d/debian.sources && apt-get update && apt-get install -y apt-utils && apt-get install rsync -y --assume-yes apt-utils &&cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
USER jenkins
EOF