use*_*465 7 buildpack spring-boot zscaler paketo
TLDR: spring boot gradlebootBuildImage
任务因 x509 证书验证错误而失败(由于 zscaler)。在哪里添加根证书?
信息
我们正在使用 spring boot (2.3) 的新“bootBuildImage”来构建 docker 镜像。
最近,我们的 IT 团队启用了“zscaler 无处不在”,它通过公司支持的“中间人”有效地路由所有 http 和 https 流量,即使用 DNS 来“网关/检查点”网络流量
错误
在此更改后,gradle 失败并显示 X509 证书验证错误:
2021-03-01T08:40:42.120-0600 [QUIET] [system.out] [creator] unable to request https://repo.
spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.7.0/spring-cloud-bindings-1.7.0
.jar
2021-03-01T08:40:42.120-0600 [QUIET] [system.out] [creator] Get "https://repo.spring.io/release/org/springframework/cloud/spring-cloud-bindings/1.7.0/spring-cloud-bindings-1.7.0.jar": x509: certificate signed by unknown authority
202
Run Code Online (Sandbox Code Playgroud)
更多上下文
题
我知道应该能够在信任存储中安装 zscaler 根证书,但不清楚哪个信任存储?(以及文件系统上的哪个位置?)
我不清楚为什么'spring cloud download'失败,但其他下载成功,即这次下载成功:
2021-03-01T08:40:34.790-0600 [QUIET] [system.out] [creator] BellSoft Liberica JRE 8.0.282
: Contributing to layer
2021-03-01T08:40:34.790-0600 [QUIET] [system.out] [creator] Downloading from https://github.com/bell-sw/Liberica/releases/download/8u282+8/bellsoft-jre8u282+8-linux-amd64.tar.gz
2021-03-01T08:40:38.913-0600 [QUIET] [system.out] [creator] Verifying checksum
Run Code Online (Sandbox Code Playgroud)
提前致谢!
Github 上也报告了类似的问题,比如这个与 Spring Cloud 相关的问题,尤其是Spring Boot 项目中的另一个问题。
正如最后提到的问题中所解释的,目前最好的解决方案可能是自定义构建过程中应使用的图像,如相关 Github 问题中的评论中所述。
这个想法是生成一个配置了必要证书的新图像,并将其用作您的builder
基础(从指示的注释中复制作为示例):
FROM gcr.io/paketo-buildpacks/builder:base
USER root
ADD server.crt /usr/local/share/ca-certificates/server.crt
RUN chmod 644 /usr/local/share/ca-certificates/server.crt \
&& update-ca-certificates
USER cnb
Run Code Online (Sandbox Code Playgroud)
这个定制的镜像将是 Spring Boot 在您的构建任务中使用的镜像。请参阅相关文档。
上述问题还表明,就在几天前,最新的 Spring Boot 快照版本包含绑定功能,该功能允许您使用 Maven 和 Gradle 插件将自定义证书添加到构建器容器。此功能将于 3 月 18 日在2.5.0-M3
Spring Boot 里程碑中提供。
归档时间: |
|
查看次数: |
443 次 |
最近记录: |