debian10 docker 安装 jenkins
mkdir /home/jenkins_home
修改权限(1000:1000 是UID和GID)
chown -R 1000:1000 /home/jenkins
docker run -d --restart=always --name Jenkins --privileged=true -u root -p 8081:8080 -p 50000:50000 -v /home/jenkins_home:/var/jenkins_home jenkins/jenkins
--privileged=true -u root 授予容器root权限
cd /home/jenkins_home
vi hudson.model.UpdateCenter.xml
将 url 修改为 清华大学官方镜像:https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
docker run -it -d -p 8080:8080 -p 50000:50000 --name jenkins --privileged=true -u root -v /home/jenkins_home:/var/jenkins_home -v /usr/bin/dos2unix:/usr/bin/dos2unix -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/usr/bin/docker -v /usr/lib64/libltdl.so.7:/usr/lib/x86_64-linux-gnu/libltdl.so.7 -v /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime -v /etc/timezone:/etc/timezone -v $(which docker-compose):/usr/bin/docker-compose -v $(which dotnet):/usr/bin/dotnet jenkins/jenkins
jenkins调用docker的权限
sudo gpasswd -a jenkins docker
sudo service jenkins restart