cat Dockerfile FROM jenkins/jenkins:2.277.1-lts-centos7 USER root RUN sed -i '/jenkins/d' /etc/passwd && sed -i 's#/root#/var/jenkins_home#' /etc/passwd && cp -a /root/.bash_profile /var/jenkins_home/ && cp -a /root/.bashrc /var/jenkins_home/ && cp -a /root/.cshrc /var/jenkins_home/
修改插件源
由于默认插件源在国外服务器,大多数网络无法顺利下载,需修改国内插件源地址:
1 2 3
cd jenkins_home/updates && \ sed -i 's/http:\/\/updates.jenkins-ci.org\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' default.json && \ sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' default.json