Jenkins Using Docker

Table of contents

Steps

  •   docker pull jenkins/jenkins
    

    Use this comment to install jenkins image.

  •   sudo mkdir /var/jenkins_home
    

    Create a File for jenkins in your machine by running this command.

  •   sudo chmod 777 /var/jenkins_home/ -R
    

    Give permission to the file.

  •   docker run -p 9080:8080 -d -v /var/jenkins_home:/var/jenkins_home jenkins/jenkins
    

    Setting the jenkins port with local ip 9080 -d to run in background the rest is the location of docker image.

  •   docker container ls
    

    To check the Status of Container.

  •   cd /var/jenkins_home/
      ls
      cd secrets
      ls
      cat initialAdminPassword
    

    Run these commands 1 at a time to achieve the password.

  •   ifconfig
    

    Use this command to get the ip of your local machine. Copy the ip and run it with the configured port (9080).

  • Install some plugins for jenkins like Blue ocean for a better interface.

  • Below are the screenshot of all the process. The ip is highlighted which to use.