Install Docker and Jenkins in Red hat 8.1/centOs

Install Docker and Jenkins in Red hat 8.1/centOs

What is a package manager in Linux?

An operating system's package manager is a tool that enables users to install, uninstall, upgrade, configure, and manage software packages. The package manager can be a command-line tool like apt-get or pacman or a graphical program like a software center.

What is a package?

A package is usually referred to as an application, but it could be a GUI application, a command line tool, or a software library (required by other software programs). A package is essentially an archive file containing the binary executable, configuration file, and sometimes information about the dependencies.

Different kinds of package managers

Package managers differ based on the packaging system, but the same packaging system may have more than one package manager.

For example, RPM has Yum and DNF, package managers. For DEB, you have apt-get, command line-based package managers.

Install docker on Rhel using yum

To install docker in Rhel 8

  1. create a repolist for the docker using the command
    cd /etc/yum.repos.d and create a repo file here
    using vim docker.repo

    then write the source

     [docker]
     baseurl=https://download.docker.com/linux/cen...
     gpgcheck=0
    
  2. check the reposlist using the yum repolist.

  3. Install docker using the command yum install docker-ce -y --nobest.

  4. start the docker services using the systemctl start docker.

  5. systemctl is the systemd command for start services start on a Linux system systemctl enable docker.

  6. check the status of docker in your system using systemctl status docker.

Install jenkins on Rhel using yum

  1. start with creating a repo but this time we will download the repo using the wget command.

     sudo wget -O /etc/yum.repos.d/jenkins.repo \
         https://pkg.jenkins.io/redhat-stable/jenkins.repo
    
     sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
    
  2. upgrade yum using the yum upgrade

  3. install the jenkins and other dependencies.

     sudo yum install java-11-openjdk 
     sudo yum install jenkins 
     sudo systemctl daemon-reload
    
  4. start the jenkins services and enables it.

     systemctl start jenkins
     systemctl enable jenkins
    
  5. check the status of jenkins using systemctl status jenkins

    it will output like this

  6. Now out next step is to unlock jenkins

    1. Browse to http://localhost:8080 (or whichever port you configured for Jenkins when installing it) and wait until the Unlock Jenkins page appears.

    2. From the Jenkins console log output, copy the automatically-generated alphanumeric password

    3. On the Unlock Jenkins page, paste this password into the Administrator password field and click Continue.

    4. click on install suggested plugins.

    5. Now it will start installing the plugins reguired.

    6. After the installation create first admin user page will appears

    7. after the Admin creation it will ask for configure url.

    8. jenkins is installed and configured.

Did you find this article valuable?

Support Ritik Gupta by becoming a sponsor. Any amount is appreciated!