0%

docker升级Jenkins容器

右键复制下载链接

登入你的jenkins容器

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

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

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

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

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

修改权限

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

退出容器并重启容器

# exit contaienr (inside container)
$ exit




# restart container (from your server)
$ docker container restart jenkins