离线安装:
- 需要复制jenkins_home根目录,可百度云下载解压至/home/apps/docker/jenkins_home下
docker load -i jenkins.tar
docker images - 启动,端口9090,映射本地目录:/home/apps/docker/jenkins_home
mkdir -p /home/apps/docker/jenkins_home
docker run -d -v /home/apps/docker/jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker -p 9090:8080 -p 50000:50000 -e JAVA_OPTS=-Duser.timezone=Asia/Shanghai --name jenkins --privileged=true jenkins/jenkins:lts
docker logs -f jenkins
docker stop jenkins
docker start jenkins
在线安装:
- 查找最新版本、安装、依赖全安装
mkdir -p /home/apps/docker/jenkins_home
docker search jenkins
docker pull jenkins/jenkins:lts
docker images
docker run -d -v /home/apps/docker/jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker -p 9090:8080 -p 50000:50000 -e JAVA_OPTS=-Duser.timezone=Asia/Shanghai --name jenkins --privileged=true jenkins/jenkins:lts
docker logs -f jenkins
docker stop jenkins
docker start jenkins
- jenkins前端页面自动运维值yarn编译运行项目,配置可参考:https://blog.csdn.net/ybb_ymm/article/details/128598004
- 配置maven
- 实际apache-maven-3.8.6服务器存放:/home/apps/docker/jenkins_home/package目录下
- JDK配置:/var/jenkins_home/package/jdk1.8.0_202
-
maven setting文件配置:/var/jenkins_home/package/apache-maven-3.8.6/conf/settings.xml
-
Maven映射地址:/var/jenkins_home/package/apache-maven-3.8.6