A detailed tutorial on how to install Jenkins on Docker for beginners

A detailed tutorial on how to install Jenkins on Docker for beginners

Jenkins is an open source software project. It is a continuous integration tool developed based on Java. It is used to monitor continuous repetitive work. It aims to provide an open and easy-to-use software platform to make continuous integration of software possible.

Basic working principle of Jenkins

The above is the basic working principle, just for developers to better understand the drawing (personal understanding), for details, please refer to the official document: https://www.jenkins.io/zh/

1. Jenkins installation

1. Find and download the jenkins image file

Start Docker and search for the Jenkins image file

docker search jenkins

Download the Jenkins image file

docker pull jenkins/jenkins

2. Create a Jenkins mount directory and grant permissions so that we can easily modify the configuration files in the container.

mkdir -p /data/jenkins_home/

chmod 777 /data/jenkins_home/

3. Create and start the Jenkins container

docker run -d -p 8090:8080 -p 8091:50000 -v /data/jenkins_home:/var/jenkins_home -v /etc/localtime:/etc/localtime --name jenkins jenkins/jenkins

  • -d Run the image in the background
  • -p 10240:8080 maps the mirror's port 8080 to the server's port 10240.
  • -p 10241:50000 maps the mirrored port 50000 to the server's port 10241
  • -v /data/jenkins_home:/var/jenkins_home The /var/jenkins_home directory is the container jenkins working directory. We mount a directory on the hard disk to this location to facilitate the use of the original working directory after subsequent image updates. Here we set the /data/jenkins_home directory we created above
  • -v /etc/localtime:/etc/localtime tells the container to use the same time settings as the server.
  • –name myjenkins gives the container an alias

4. Check whether Jenkins is started successfully. If the port number appears as shown in the figure below, it means that it is started successfully.

docker ps -l

insert image description here

5. View Docker container logs

docker logs jenkins

6. Configure image acceleration and enter the cd /data/jenkins_home directory

cd /data/jenkins_home

Modify the content in hudson.model.UpdateCenter.xml

vi hudson.model.UpdateCenter.xml

Before modification:

insert image description here

Change the URL to the official mirror of Tsinghua University: https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json

insert image description here

7. Visit the Jenkins page and enter your IP plus 8090

insert image description here

8. To obtain the administrator password, edit the initialAdminPassword file and enter the password you logged in with to start using it.

vi /data/jenkins_home/secrets/initialAdminPassword

insert image description here

The above is the detailed content of the detailed tutorial on installing Jenkins with Docker, which is a must-read for novices. For more information about installing Jenkins with Docker, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • Detailed process of installing Jenkins-2.249.3-1.1 with Docker
  • Practical notes on installing Jenkins with docker-compose
  • How to install Jenkins using Docker
  • Detailed tutorial on installing the jenkins container in a docker environment
  • Install Jenkins with Docker and solve the problem of initial plugin installation failure
  • Sample code for installing Jenkins using Docker
  • Docker deployment and installation steps for Jenkins

<<:  Understand the rendering process of HTML pages in preparation for learning front-end performance optimization

>>:  52 SQL statements to teach you performance optimization

Recommend

The best explanation of HTTPS

Good morning everyone, I haven’t updated my artic...

Detailed explanation of MySQL index selection and optimization

Table of contents Index Model B+Tree Index select...

CSS selects the first child element under the parent element (:first-child)

Preface I recently used :first-child in a project...

idea combines docker to realize image packaging and one-click deployment

1. Install Docker on the server yum install docke...

Detailed explanation of the process of installing MySQL on Ubuntu 18.04.4

Let's take a look at the process of installin...

Vue implements zip file download

This article example shares the specific code of ...

js array fill() filling method

Table of contents 1. fill() syntax 2. Use of fill...

Web designers should optimize web pages from three aspects

<br />With the increase of bandwidth, there ...

CSS3 sample code to achieve element arc motion

How to use CSS to control the arc movement of ele...

How to install Docker on Windows Server 2016

Recently Microsoft released Windows Server 2016, ...

Detailed explanation of the execution process of MySQL query statements

Table of contents 1. Communication method between...

Take you to understand MySQL character set settings in 5 minutes

Table of contents 1. Content Overview 2. Concepts...

What are the drawbacks of deploying the database in a Docker container?

Preface Docker has been very popular in the past ...