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

Creation, constraints and deletion of foreign keys in MySQL

Preface After MySQL version 3.23.44, InnoDB engin...

Analyzing Linux high-performance network IO and Reactor model

Table of contents 1. Introduction to basic concep...

Solve the matching problem in CSS

Problem Description As we all know, when writing ...

How to use docker+devpi to build local pypi source

Some time ago, I needed to use pip downloads freq...

Example of creating a virtual host based on Apache port

apache: create virtual host based on port Take cr...

Using MySQL in Windows: Implementing Automatic Scheduled Backups

1. Write a backup script rem auther:www.yumi-info...

Analysis of mysql view functions and usage examples

This article uses examples to illustrate the func...

HTML form application includes the use of check boxes and radio buttons

Including the use of check boxes and radio buttons...

JavaScript to achieve fancy carousel effect

This article shares two methods of implementing t...

Detailed tutorial on how to install mysql8.0 using Linux yum command

1. Do a good job of cleaning before installation ...

HTML form and the use of form internal tags

Copy code The code is as follows: <html> &l...

A brief discussion on the solution of Tomcat garbled code and port occupation

Tomcat server is a free and open source Web appli...

Understanding JavaScript prototype chain

Table of contents 1. Understanding the Equality R...

Detailed explanation of React component communication

Table of contents Component Communication Introdu...