准备一个ubuntu虚拟机(此处用vagrant)
vagrant init envimation/ubuntu-xenial-docker
修改Vagrantfile
配置网络模式和Ip
config.vm.network "public_network", ip:"192.168.1.14"
配置内存大小,此处2G
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
end
vagrant ssh
在虚拟机中安装java8
sudo mkdir /opt/java
sudo chown vagrant /opt/java
tar zxf jdk-8u191-linux-x64.tar.gz
sudo cp -r ~/jdk1.8.0_191/* /opt/java
echo 'export JAVA_HOME=/opt/java/;export PATH=${JAVA_HOME}/bin:${PATH}' >> ~/.bashrc
source ~/.bashrc
java -version
运行jenkins
下载[jenkins.war]
java -jar jenkins.war --httpPort=8080
cat /home/vagrant/.jenkins/secrets/initialAdminPassword
输入获得的密码
选择安装推荐
输入账号信息
至此安装结束