1.以root用户进入jenkins容器
docker exec -it -u root ID bash
2.在容器中下载jenkins的最新war包
wget https://mirrors.jenkins.io/war/2.442/jenkins.war
3.查看容器中jenkins war包的位置,并备份原来的war包
whereis jenkins
cd /usr/share/jenkins
cp jenkins.war jenkinsBAK.war
4.将/var/jenkins_home下的包cp到/usr/share/jenkins下覆盖
cp /var/jenkins_home/jenkins.war /usr/share/jenkins/
5.退出容器并重启
docker restart ID