1. Installation
1. Pull the jenkins image
docker pull jenkins/jenkins
2. Create jenkins working directory
mkdir /home/jenkins
3. Grant permissions to the working directory
chown -R 1000:1000 jenkins/
4. Start jenkins
sudo docker run -itd -p 8080:8080 -p 50000:50000 --name jenkins --privileged=true -v /home/jenkins_home:/var/jenkins_home jenkins
5. Check the running log
docker logs -f jenkins
6. Check the initial password and log in to jenkins
cat /home/jenkins/secrets/initialAdminPassword
7. Enter the jenkins container
docker exec -it jenkins /bin/bash
2. Frequently Asked Questions
- If you are stuck on the startup page
a. Turn off the firewall
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service
b. Restart docker and restart jenkins
systemctl restart docker
docker start jenkins
- Installation plug-in download is slow
a. Change "connectionCheckUrl":" http://www.google.com/" to "connectionCheckUrl":" http://www.baidu.com/"
systemctl restart docker
docker start jenkins
b. Replace: http://updates.jenkins-ci.org/update-center.json with: http://mirror.esuni.jp/jenkins/updates/update-center.json
vi /home/jenkins/hudson.model.UpdateCenter.xml