New Jenkins Container And Update Jenkins (Docker)

Jim Kang
Jim Kang
Jan 12, 2018 · 2 min read
Image for post
Image for post

let me keep it short, since you’re super busy with your daily tasks. Assuming you’ve logged into your server with bash

  1. Create a directory that will hold your jenkins content (in host)
# I'll keep it as "jenkins", you can use "jenkins_home" if you wishmkdir -p $HOME/jenkins

2. Start your jenkins image

# if you're using other names, replace $HOME/jenkins with your choice
# in case you want to change port, use this
# -e JENKINS_OPTS="--httpPort=80" (remember to change 8080:8080 below to 80:80)
docker container run \
--name jenkins \
-p 8080:8080 -p 50000:50000 \
-v $HOME/jenkins:/var/jenkins_home \
-d \
jenkins

3. Write down the password you see on your screen

4. Open your browser and access http://YOUR-SERVER-IP:8080 and follow the steps

How To Update Jenkins

  1. Right click on the download link and “copy link address”
Image for post
Image for post

2. Log in into jenkins container

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

3. Download the update with the address you copied in step 1

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

4. Move it to the correct place

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

5. Change permission (thanks Buvanesh Kumar)

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

6. Exit container and restart the container

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

In case if you see a deprecated protocols: JNLP-connect, JNLP2-connect warning, here’s what you can do

Image for post
Image for post
Image for post
Image for post

Go on, leave here and enjoy life!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store