Foreword
Today we learn how to quickly install jenkins docker and Zen systems.
If you have not useful to Zen or other management tools, it is strongly recommended to install at Zen quickly docker to use it together with
A, doocker install jenkins
1, first install the Docker, refer to: https://www.cnblogs.com/gsxl/p/11674378.html
2, first create a mount directory: jenkins, and give permission (or else get up do not blame me):
# Change directory permissions: uid permissions to 1000 [root @ iZbp19lugf22zbsubsf1y6Z ~] # mkdir ~ / Jenkins [root @ iZbp19lugf22zbsubsf1y6Z ~] # chown -R 1000 : 1000 ~ / Jenkins
Then finish up a command (the time just waiting to be downloaded):
docker run -itd -p 3006:8080 -p 50000:50000 -v ~/jenkins:/var/jenkins_home -e JAVA_OPTS=-Duser.timezone=Asia/Shanghai --name jenkins jenkinsci/blueocean
- -p, port 3306 is externally accessible, 3306 8080 corresponding to the port inside of the container (Jenkins default port 8080)
- --privileged = true, open root privileges
- -v, the ~ / jenkins correspond to the interior of the container to mount the working directory / var / jenkins_hom
- -e, when jenkins changed Beijing area
- --name jenkins, after running container name
- jenkins / jenkins: lts, 镜像
3. The results are as follows:
[root@iZbp19lugf22zbsubsf1y6Z ~]# docker run -itd -p 3006:8080 -p 50000:50000 -v ~/jenkins:/var/jenkins_home -e JAVA_OPTS=-Duser.timezone=Asia/Shanghai --name jenkins jenkinsci/blueocean Unable to find image 'jenkinsci/blueocean:latest' locally latest: Pulling from jenkinsci/blueocean e7c96db7181b: Pull complete f910a506b6cb: Pull complete c2274a1a0e27: Pull complete fb11157cad2d: Pull complete 671d4a1cbe1a: Pull complete 09edd91768a5: Pull complete debb14ec40c1: Pull complete 480a5bd152f8: Pull complete cb72d6a92334: Pull complete 757db70f71a1: Pull complete 0128fdd173b0: Pull complete 9610f4e0da3f: Pull complete 210df9d82fb2: Pull complete 22f95a9fa254: Pull complete b34b4d5b5bcb: Pull complete Digest: sha256:af91aea57ac78588d281b1af34905734cdb6ebbb8dc28b8519d1dc95bad87b07 Status: Downloaded newer image for jenkinsci/blueocean:latest fa81928c4dcef3bcda052b7ae50f5ddec90445d2e849dd648e86b384b8a12bad
4, ip + port web access (first start to wait jenkins buffer time)
5, will be prompted to enter the password, we look to get a password to run cat directory according to the directory, you can enter the next step.
[root@iZbp19lugf22zbsubsf1y6Z ~]# docker exec -it jenkins cat /var/jenkins_home/secrets/initialAdminPassword 7dd3a0c99c2c4bea939971e636d1eb47 [root@iZbp19lugf22zbsubsf1y6Z ~]#
6, install the recommended plug-in, it is strongly recommended to change the wave profile jenkins, from plug-in installed less than a minute all sound good
① View container: docker ps
[root@iZbp19lugf22zbsubsf1y6Z ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d3db015c44a6 jenkins/jenkins:lts "/sbin/tini -- /usr/…" 5 minutes ago Up 5 minutes 0.0.0.0:50000->50000/tcp, 0.0.0.0:3006->8080/tcp jenkins
②进入容器bash:docker exec -it 容器id /bin/bash
[root@iZbp19lugf22zbsubsf1y6Z ~]# docker exec -it jenkins /bin/bash
jenkins@d3db015c44a6:/$
③ cd 到 updates 目录下:执行这一句即可修改配置文件,路径是:/var/jenkins_home/updates/default.json
jenkins@dc8eac41938b:/$ cd /var/jenkins_home/updates/ jenkins@dc8eac41938b:~/updates$ sed -i 's/http:\/\/updates.jenkins-ci.org\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' default.json && sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' default.json jenkins@dc8eac41938b:~/updates$
④ exit 回来,接着重启jenkins输入:docker restart jenkins,重新打开jenkins web,选择推荐安装的插件,会发现非一般的速度给您安装好了。
7、(插件安装太慢,肯定是您没有重启jenkins)完善信息,点击下一步、下一步这样就大功告成了。
二、docker 安装禅道
1、前面也讲过 docker 安装,只需要一条命令回车就完事了:
docker run -d -p 8888:80 -p 3386:3306 -e USER="admin" -e PASSWD="123456" -e BIND_ADDRESS="false" -e SMTP_HOST="163.177.90.125 smtp.exmail.qq.com" -v /data/zbox/:/opt/zbox/ --name zentao-server idoop/zentao:latest
- 账号为:admin
- 密码为:123456
运行结果:
[root@iZbp19lugf22zbsubsf1y6Z ~]# docker run -itd -p 8888:80 -p 3316:3306 -e USER="admin" -e PASSWD="123456" -e BIND_ADDRESS="false" -e SMTP_HOST="163.177.90.125 smtp.exmail.qq.com" -v /data/zbox/:/opt/zbox/ --name zentao idoop/zentao:latest Unable to find image 'idoop/zentao:latest' locally latest: Pulling from idoop/zentao 7ddbc47eeb70: Pull complete c1bbdc448b72: Pull complete 8c3b70e39044: Pull complete 45d437916d57: Pull complete 750e6c6007ed: Pull complete c1a7f7e493d0: Pull complete ddcf1757dffa: Pull complete 988f5ca0317c: Pull complete ec88538220d9: Pull complete Digest: sha256:3355b9e6a0d5fa50552b10ed82517cc058ed7fc6e96d1a0edab333c842003ac4 Status: Downloaded newer image for idoop/zentao:latest aba48aac1f2d1c15f4456c62fdc871e65652e7c4d421b2b3bace9c1f08e3330a [root@iZbp19lugf22zbsubsf1y6Z ~]#
2、查看运行容器:docker ps
[root@iZbp19lugf22zbsubsf1y6Z ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES aba48aac1f2d idoop/zentao:latest "docker-entrypoint" 9 minutes ago Up 8 minutes (healthy) 0.0.0.0:8888->80/tcp, 0.0.0.0:3316->3306/tcp zentao
3、浏览器打开:ip + 端口
jenkins 如需汉化中文版参考这篇文章:https://www.cnblogs.com/gsxl/p/12129296.html
欢迎来QQ交流群:482713805