Docker 安装 jenkins
1、jenkins官网(https://www.jenkins.io/download/),拉取镜像
docker pull jenkins/jenkins:lts
2、前提在本地安装好jdk和maven和nodejs,挂载jdk和maven和nodejs的安装目录到容器,启动容器
mkdir /var/jenkins_home
docker run -u root -itd -p 8086:8080 -p 50000:50000 --name=jenkins --restart=on-failure -v /var/jenkins_home:/var/jenkins_home -v /usr/local/maven/apache-maven-3.8.8/:/usr/local/maven -v /usr/local/jdk1.8.0_371/:/usr/local/jdk -v /usr/local/node-v16.20.0-linux-x64/:/usr/local/nodejs jenkins/jenkins:lts
3、查看初始密码
cat /var/lib/docker/volumes/jenkins_home/_data/secrets/initialAdminPassword