1.下载jenkins,linux执行yum的repo中默认没有Jenkins,需要先将Jenkins存储库添加到yum repos,执行下面的命令:
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
2.然后执行下面的命令:
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
3.安装jenkins
yum install jenkins
4.修改配置文件中的端口和用户名
vi /etc/sysconfig/jenkins
5.如果报错Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details
a.执行systemctl status jenkins.service可见是找不到java,需要配置上你本地安装的java目录
b.配置java目录:
执行vim /etc/profile可以查看你环境变量中的java目录,然后执行vi /etc/rc.d/init.d/jenkins添加新目录,如下图,注意:目录要写到/bin/java中。
6.启动jenkins
service jenkins start
6.访问jenkins
http://ip:10240
7.查看日志: vi /var/log/jenkins/jenkins.log
Docker安装请参考:https://www.cnblogs.com/fuzongle/p/12834080.html