Jenkins (AlmaLinux 8)

Jenkins (AlmaLinux 8)

  • OS: almalinux 8

Description

Jenkins is a popular open-source automation server used for continuous integration and continuous delivery (CI/CD) pipelines. It allows developers to automatically build, test, and deploy code changes, making the software development process more efficient and reliable.

Software included

Package Version
Jenkins latest
Docker 3.20.10
Docker compose 2.12.2
containerd.io 1.6.10

Initial start of the service

This application uses Docker to provide faster startup of the associated software (Jenkins) and direct use of it. This eliminates the need to familiarize yourself with its specifics in terms of configuration and installation. To start working directly with the application, all you have to do is visit the IP address assigned to your virtual machine through a browser.

Note: By default, Jenkins can be accessed directly by IP address. To start using Jenkins with your real domain, you first need to point the domain in question to your IP address and change the settings for where Jenkins opens from through its admin panel.

Quick settings and frequently asked questions

  • Logging into the cloud service is done using an SSH key or password that you have specified.
  • Docker is installed as recommended by the official docker documentation.
  • The standard docker and docker compose commands are now available in this application.
  • When the virtual machine is first started, it takes a few minutes before a Docker container containing Jenkins is started.
  • Jenkins data is set to persistent and is located in /opt/jenkins/data/.
  • By default, Jenkins runs on all available interfaces on the machine. Jenkins access port is 6379.

Additional Docker settings

Additional Jenkins settings that you can change and that are controlled directly by Docker are set as variable values in the configuration file /opt/docker-jenkins/docker-compose.yml:

Note: After changing any of the values, you must recreate the Docker containers on which the application is running. For more information, please read the Recreating Docker containers section.

  • JENKINS_USERNAME: Jenkins admin user. Default: admin
  • JENKINS_PASSWORD: Jenkins admin password. Default: P@ssw0rD1!
  • JENKINS_EMAIL: Jenkins admin email. Default: user@example.com
  • JENKINS_HOME: Jenkins home directory. Default: /bitnami/jenkins/home
  • JENKINS_HTTP_PORT_NUMBER: Port used by Jenkins for HTTP. Default: 8080
  • JENKINS_HTTPS_PORT_NUMBER: Port used by Jenkins for HTTPS. Default: 8443
  • JENKINS_EXTERNAL_HTTP_PORT_NUMBER: Port used by Jenkins to generate URLs and links when accessed over HTTP. Default: 80
  • JENKINS_EXTERNAL_HTTPS_PORT_NUMBER: Port used by Jenkins to generate URLs and links when accessed over HTTPS. Default: 443
  • JENKINS_JNLP_PORT_NUMBER: Port used by Jenkins for JNLP. Default: 50000
  • JENKINS_FORCE_HTTPS: Enable Jenkins redirect to HTTPS. Default: no
  • JENKINS_SKIP_BOOTSTRAP: Skipping initial bootstrapping run. Default: no

Working with Docker

The organization of this application is entirely done using Docker. In this way, we can provide you with ready-made applications faster. In addition, their configuration is more flexible and quite controllable. To be able to control this application, however, you need to know some basic Docker functionalities and features.

Restarting all services

Restarting the database and the Docker container that contains Jenkins itself, along with the rest of the software, can be done in two ways:

  1. By restarting the entire virtual machine
  2. Restarting the Docker containers, which is the faster option. To do this, access your machine via SSH, and run the following commands:
sudo su -
cd /opt/docker-jenkins
docker compose restart

Recreating Docker containers

Recreation of a docker container may be necessary if you've changed the configuration inside the docker-compose.yml file. If there are changes, please follow these steps:

cd /opt/docker-jenkins/
docker compose stop
docker compose up -d

Checking the status of the Docker application

To check, you need to run the following commands:

sudo su -
docker ps -a

Please pay attention to the STATUS column. It should show how long the service has been running, for example Up X minutes. If the status is Restarting then you need to check what is wrong with the application. In such a case, you can check by following the application logs as follows:

  1. Get the application name that you can see in the NAMES column from the output of the docker ps -a command. View the logs with the docker logs <NAME> command, where is the name of the container.

Changing settings

The settings in section Additional Docker settings can be set in the docker-compose.yml file. The path to it is described again in this section. To change a setting, open the configuration file and note the environment section under jenkins. Each configuration option must be described on a new line with a dash in front, as in the following example:

    environment:
      - JENKINS_USERNAME=admin
      - JENKINS_PASSWORD=P@ssw0rD1!

Please note that the correct indentation (number of spaces) must also be observed, as this is important for yaml configuration files.