rancher1.6.30+jenkins+nexus+gitea
Overview
rancher1.6
1sudo docker run -d --restart=unless-stopped --name rancher -p 8080:8080 rancher/server:v1.6.30 --db-host 192.168.10.211 --db-user root --db-pass 123456 --db-name rancher
备注
: rancher1.6.30只支持mysql5.7版本,不支持mysql8.0,甚至不能支持mysql5.7的开源版本: MariaDB 10.3
1# 非mysql5.7时,报错可以使用如下命令查看
2sudo docker logs <container_id>
jenkins
1sudo apt-get update
2sudo apt install openjdk-11-jdk
3wget https://github.com/jenkinsci/jenkins/releases/download/jenkins-2.450/jenkins.war
4# 启动
5java -Djava.awt.headless=true -jar /home/mac/jenkins/jenkins.war --webroot=%C/jenkins/war --httpPort=3533
将java命令封装到run.sh
1#!/bin/bash
2cd /home/mac
3java -Djava.awt.headless=true -jar /home/mac/jenkins/jenkins.war --webroot=%C/jenkins/war --httpPort=3533
将run.sh脚本加入到自动启动
1$ sudo vim /etc/systemd/system/jenkins.service
2[Unit]
3Description=Jenkins Server
4After=network.target
5
6[Service]
7Type=simple
8User=mac
9ExecStart=/home/mac/jenkins/run.sh
10Restart=on-failure
11
12[Install]
13WantedBy=multi-user.target
14$ sudo systemctl daemon-reload
15
16$ sudo systemctl enable jenkins
17
18$ sudo systemctl start jenkins
注意
jenkins升级可能会导致一些plugins执行报错,常见的是ClassNotFound,这个一般可以通过下载缺失的jar,放到%C/jenkins/war/WEB-INF/lib下即可