部分报错信息如下:
2023-10-03 14:52:10.515+0000 [id=86] INFO h.m.UpdateCenter$UpdateCenterConfiguration#download: Downloading jdk-tool
2023-10-03 14:52:15.529+0000 [id=86] SEVERE h.model.UpdateCenter$DownloadJob#run: Failed to install jdk-tool
java.net.UnknownHostException: updates.jenkins.io
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:229)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.base/java.net.Socket.connect(Socket.java:609)
at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:305)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:177)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:509)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:604)
显然是因为 Jenkins 无法连接到外部网络导致的
进入 docker 内部验证一下猜想:curl www.baidu.com,提示 UnknownHost,果然没网
百度找一下解决方案
yum install -y bridge-utils #安装brctl命令
pkill docker #终止进程
iptables -t nat -F #清空nat表的所有链
ifconfig docker0 down #停止docker默认网桥
brctl delbr docker0 #删除网桥
systemctl restart docker #重启docker服务
重启 Jenkins,开始安装,美滋滋~
参考文献:
https://www.jb51.net/article/148874.htm
https://blog.csdn.net/zwl_001/article/details/133532095
最后,附上一张 Jenkins 后台(斜眼笑)