docker安装Jenkins
时间:2021-07-23 17:46:56
收藏:0
阅读:0
拉取镜像
docker pull jenkins/jenkins:lts
创建docker-compose.yml 文件 (主要习惯 也可以不用这种方式)
version: "2"
services:
jenkins:
image: jenkins/jenkins:lts
container_name: jenkins
environment:
# - TZ="Asia/Shanghai"
- timezone="Asia/Shanghai"
- JENKINS_JAVA_OPTIONS="-Xms1024m -Xmx2048m -XX:PermSize=256m -XX:MaxPermSize=512m -Duser.timezone=Asia/shanghai -Djava.awt.headless=true"
- JENKINS_OPTS="--prefix=/jenkins"
- JENKINS_ARGS="--prefix=/jenkins"
privileged: true
user: root
volumes:
- /data/jenkins/home:/var/jenkins_home
- /etc/localtime:/etc/localtime
ports:
- 8500:8080
- 50000:50000
restart: on-failure
先创建挂载目录,然后执行
docker-compose up -d
-d :表示后台启动 第一次可以不使用 看下启动是否正常
如果出现
java.net.UnknownHostException: updates.jenkins.io
jenkins | at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
jenkins | at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
jenkins | at java.net.Socket.connect(Socket.java:607)
jenkins | at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:288)
可以进入我们的挂载目录 /data/jenkins/home
vim hudson.model.UpdateCenter.xml
评论(0)