Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of docker starting jenkins environment

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to solve the problem of docker starting jenkins environment". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to solve the problem of starting the jenkins environment with docker.

[note:] the docker image of jenkins needs to be obtained directly from the official website. The docker image obtained elsewhere may fail to install the plug-in because the Jenkins version is too low.

Basic working principle of jenkins

1. Pull the image

You need to enter from the official website: Jenkins download and deployment

Command:

Docker pull jenkins/jenkins:lts2. Create a directory

To prevent important files in jenkins from being lost due to damage or deletion of containers, create files for external mounting

Mkdir / data/jenkins

And you need to open full read and write permissions for docker process operations to the directory

Chmod 777 / data/jenkins3. Launch Container docker run-d-p 10240 data/jenkins:/var/jenkins_home 8080-p 10241 data/jenkins:/var/jenkins_home 50000-- restart always-v / data/jenkins:/var/jenkins_home-v / etc/localtime:/etc/localtime-- name jenkins jenkins/jenkins:lts

And check the log.

Docker logs-f jenkins4. Configure image acceleration and enter the cd / data/jenkins directory.

Modify the content in vi hudson.model.UpdateCenter.xml

Before modification

Modify url to the official image of Tsinghua University: https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json

After modification

5. Administrator password acquisition method

Edit the initialAdminPassword file (check, enter the password in the login password, and start using it.

Enter the container to view the password:

Docker exec-it jenkins / bin/bashcat / data/jekins/secrets/initialAdminPassword

The lts image is the latest version by default. Be sure to pull this or you can't download the plug-in.

6. Do not choose to install the recommended plug-in

Otherwise, it will appear that the version does not support many plug-ins failed to install, select the plug-in to install

At this point, I believe you have a deeper understanding of "how to solve the problem of docker starting the jenkins environment". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report