docker升级Jenkins容器

右键复制下载链接

登入你的jenkins容器

1
2
#using host's root with -u 0
$ docker container exec -u 0 -it jenkins bash

下载更新,地址为第一步复制出来的链接

1
2
# inside the container, using 2.89.2 as example
$ wget http://updates.jenkins-ci.org/download/war/2.89.2/jenkins.war

移动下载的源文件到合适的位置

1
$ mv ./jenkins.war /usr/share/jenkins

修改权限

1
$ chown jenkins:jenkins /usr/share/jenkins/jenkins.war (updated)

退出容器并重启容器

1
2
# exit contaienr (inside container)
$ exit
1
2
# restart container (from your server)
$ docker container restart jenkins