1、下载jdk1.8
scp root@106.12.199.141:/home/jdk-8u231-linux-x64.tar.gz /home
2、下载docker
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-18.06.3.ce-3.el7.x86_64.rpm
3、安装docker
yum localinstall docker-ce-18.06.3.ce-3.el7.x86_64.rpm
4、启动docker
systemctl start docker
5、进入docker文件夹
cd /etc/docker
6、创建daemon.json文件
touch daemon.json
7、编辑daemon.json文件
vi daemon.json
{ "registry-mirrors": ["https://glqt73d8.mirror.aliyuncs.com"] }
8、重新启动docker
systemctl restart docker
9、docker下安装jenkins
docker pull jenkins/jenkins:lts
10、进入home
cd /home
11、在home下建立jenkins子目录
mkdir jenkins
12、给与可读写权限
chown -R 1000:1000 /home/jenkins/
12、启动jenkins
docker run -itd -p 8081:8080 -p 50001:50000 --name jenkins --privileged=true -v /home/jenkins:/var/jenkins_home jenkins/jenkins:lts
13、删除jenkins
1).先停止jenkins服务
docker stop jenkins
2).删除jenkins容器
docker rm jenkins
3).删除jenkins镜像
docker rmi 镜像名:版本号 (docker rmi jenkins/jenkins:lts)
14、安装git
yum -y install git
15、查看git路径
command -v git