Install and upgrade Jenkins with Docker

Installation

$ docker pull jenkins
$ docker run -d -p 8080:8080 -p 50000:50000 --name jenkins --restart=always jenkins

Upgrade

# check version
$ docker exec -it jenkins java -jar /usr/share/jenkins/jenkins.war --version
# download latest jenkins.war from http://updates.jenkins-ci.org/download/war/
$ wget http://updates.jenkins-ci.org/download/war/2.167/jenkins.war
# replace file
$ sudo docker cp jenkins.war jenkins:/usr/share/jenkins/

Change Context to /jenkins

# edit /usr/local/bin/jenkins.sh
# find line "java -jar ..." and replace: 
java -jar /usr/share/jenkins/jenkins.war --prefix=/jenkins

Reference

[1] Upgrade Jenkins server to a new version


本文作者: Vincent0700
本文地址: https://vincentstudio.info/2019/03/11/022_Install_and_upgrade_Jenkins_with_Docker/
版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!