How to update jenkins in docker container

Always take necessary backups. You can go to Manage Jenkins -> Available -> Backup plugin and backup the jobs and other things you want for safety.

  1. sudo docker container exec -u 0 -it czcjenkins bash
    here czcjenkins is my container name.
  2. wget http://updates.jenkins-ci.org/download/war/2.273/jenkins.war
    You can chekc the latest jenkins available from this link or just replace the 2.273 with the version you want to upgrade:
    https://www.jenkins.io/download/
  3. mv ./jenkins.war /usr/share/jenkins/
  4. chown jenkins:jenkins /usr/share/jenkins/jenkins.war
    here jenkins is the user, so keep same as it is only.
  5. exit
    exit from the czcjenkins container.
  6. sudo docker restart czcjenkins

One comment

Leave a Reply