1、下载jenkins docker
https://www.jianshu.com/p/12c9a9654f83
2、创建本地maven挂载目录和jenkins挂载目录
chmod -R 777 本地目录
3、启动docker,--privileged=true
docker run -id --privileged=true -p 8080:8080 -p 50000:50000 -v /opt/jenkins:/var/jenkins_home -v /opt/apache-maven-3.6.3:/usr/local/maven --name jenkins -idt jenkins/jenkins:lts
4、拷贝最新版jenkins.war本到docker
docker cp jenkins.war f15b3dea0bc7:/usr/share/jenkins/jenkins.war
5、拷贝cloudbees-folder.hpi到jenkins目录/jenkins/war/WEB-INF/detached-plugins
6、修改镜像源https://jenkins-zh.cn/tutorial/management/plugin/update-center/
目录:/jenkins/hudson.model.UpdateCenter.xml
7、启动docker
默认密码路径/jenkins/secrets/initialAdminPasswords