Jenkins建议要求4G或8G以上
一、docker 方式安装
1.搭建docker环境,参考我的另一篇博客:Centos7安装Docker
2.官方镜像
dockerhub镜像推荐采用: “jenkins/jenkins:lts”
原官方仓库Jenkins已经被替代了。
#查看镜像
[root@linux05 ~]# docker search jenkins
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
jenkins DEPRECATED; use "jenkins/jenkins:lts" instead 5534 [OK]
jenkins/jenkins The leading open source automation server 3183
jenkins/jnlp-slave a Jenkins agent which can connect to Jenkins… 151 [OK]
jenkins/inbound-agent 75
bitnami/jenkins Bitnami Docker Image for Jenkins 54 [OK]
jenkins/slave base image for a Jenkins Agent, which includ… 48 [OK]
jenkins/agent 44
jenkins/ssh-slave A Jenkins slave using SSH to establish conne… 38 [OK]
jenkins/ssh-agent Docker image for Jenkins agents connected ov… 27
jenkins/jnlp-agent-docker 8
jenkins/jnlp-agent-maven A JNLP-based agent with Maven 3 built in 7
jenkins/pct Plugin Compat Tester 5 [OK]
jenkins/evergreen An automatically self-updating Jenkins distr… 5
jenkins/jenkins-experimental Experimental images of Jenkins. These images… 3 [OK]
jenkins/jnlp-agent-python A JNLP-based agent with Python built in 3
jenkins/jnlp-agent-alpine 2
jenkins/jnlp-agent-node 1
rancher/jenkins-jenkins 1
jenkins/ath Jenkins Acceptance Test Harness 1 [OK]
jenkins/jenkinsfile-runner Jenkinsfile Runner packages 1
jenkins/core-pr-tester Docker image for testing pull-requests sent … 1
jenkins/jnlp-agent-ruby 1
rancher/jenkins-master Jenkins Server 1 [OK]
rancher/jenkins-slave Jenkins Build Slave 0 [OK]
rancher/jenkins-jnlp-slave
# Jenkins 数据存放目录需要提前创建
[root@linux05 data]# mkdir -p /data/jenkins/home
#授权docker对该目录读写权限
[root@linux05 data]# chown 1000:1000 -R jenkins/ #或者
[root@linux05 data]# chmod 777 -R jenkins/
[root@linux05 ~]# docker run -d --name jenkins -p 8080:8080 -p 50000:50000 -v /data/jenkins/home:/var/jenkins_home jenkins/jenkins:latest
# 查看日志,获取初始密码
[root@linux05 ~]# docker logs -f jenkins
*************************************************************
*************************************************************
*************************************************************
Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:
0762d14949ab45da8dc9855b3f96d5ab
This may also be found at: /var/jenkins_home/secrets/initialAdminPassword
*************************************************************
*************************************************************
*************************************************************
浏览器打开 IP:8080即可访问,输入获取的密码
后续配置根据个人需求,见仁见智。
一、rpm 方式安装
1.上传rpm jenkins-2.89.4-1.1.noarch.rpm
2.安装rpm包
rpm -ivh jenkins-2.89.4-1.1.noarch.rpm
3.修改/etc/init.d/jenkins 添加java路径
vi /etc/init.d/jenkins
candidates="
/usr/local/java8/bin/java (此处添加jdk路径)
/etc/alternatives/java
/usr/lib/jvm/java-1.8.0/bin/java
/usr/lib/jvm/jre-1.8.0/bin/java
/usr/lib/jvm/java-1.7.0/bin/java
/usr/lib/jvm/jre-1.7.0/bin/java
/usr/bin/java
4.启动
systemctl start jenkins.service(第一种) systemctl daemon-reload(系统推荐) systemct start jenkins
5.登录 输入ip:8080
6.查看登录密码
cat /var/lib/jenkins/secrets/initialAdminPassword
汉化
先安装locale.hpi ,再安装localization-support.hpi , 最后安装 localization-zh-cn.hpi
gitblit插件
先git.hpi 再scm-api.hpi 最后gitblit.hpi
插件安装https://blog.csdn.net/ezreal_tao/article/details/82528185