拉取镜像

docker pull jenkins/jenkins:lts
官方下载

运行容器

  • docker run -it -v /home/jenkins:/var/jenkins_home -p 8888:8080 -p 50000:50000 --name jenkins8888 jenkins/jenkins:lts
  • 报错
  • 原因 :官方文档 Ensure that /your/home is accessible by the jenkins user in container (jenkins user - uid 1000) or use -u some_other_user parameter with docker run.
  • 解决方案:
  • groupadd -g 1000 jenkinsUsers
  • useradd -u 1000 -g 1000 -d /users/jenkins/jenkinsAdmin -m jenkinsAdmin
  • passwd jenkinsAdmin
  • chown -R 1000:1000 /home/jenkins

插件换源

1 http://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json  //https 改为 http
2 http://mirror.xmission.com/jenkins/updates/update-center.json   # 推荐
3 http://mirrors.shu.edu.cn/jenkins/updates/current/update-center.json
```.  

###插件安装  
#### 推荐插件安装  
 [推荐插件安装](https://www.cnblogs.com/zhanglianghhh/archive/2018/10/11/9770529.html)