Skip to content

Running Jenkins in docker

Jerome Cabugwason edited this page Dec 6, 2022 · 2 revisions

Running Jenkins in docker

Install and run docker

sudo docker run --name jenkins -p 52653:8080 -p 48338:50000 -d -v jenkins_home:/var/jenkins_hone jenkins/jenkins:lts

Copy the container ID hash

In your terminal containerID looks like this:

  • 2dbb3dd6fc980e6c45949be8123a4b434491b17ccc46f41e896a82eee50ae68f

Terminal output:

...
1d89986af1b8: Pull complete
Digest: sha256:23b8713004846412ad7cd72ed2debe49f3dc73d70ea1436c44a8cfa202fb405f
Status: Downloaded newer image for jenkins/jenkins:lts
2dbb3dd6fc980e6c45949be8123a4b434491b17ccc46f41e896a82eee50ae68f // this id here in you terminal

Get the jenkins admin login password token by running

docker logs <containerID>

Terminal output should look like below

Copy the password given below

*************************************************************
*************************************************************
*************************************************************

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

781e237ecd09429daf7122d30d083e55 // this one in your terminal

This may also be found at: /var/jenkins_home/secrets/initialAdminPassword

*************************************************************
*************************************************************
*************************************************************

login in browser using:

http://localhost:52653

Done

  • Paste the password
  • Install recommended
  • Follow instructions