[英]Jenkins docker container behind proxy refuses to download plugins cert error
Problem:问题:
When deploying Jenkins, at the time of installing plugins, every single plugin fails to download with the following Java error:部署 Jenkins 时,在安装插件时,每个插件都无法下载,并出现以下 Java 错误:
Caused: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Troubleshooting:故障排除:
ENV CURL_OPTIONS -Lk --proxy our.proxy.com:1234
and spinning up the container, I still see the same error.但是,当添加ENV CURL_OPTIONS -Lk --proxy our.proxy.com:1234
并启动容器时,我仍然看到相同的错误。Environment:环境:
Config files:配置文件:
version: '3.7'
services:
jenkins:
container_name: jenkins
build:
context: ./jenkins
dockerfile: ./jenkins.Dockerfile
ports:
- 8080:8080
- 50000:50000
volumes:
- jenkins-data:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
environment:
DOCKER_SOCKET: /var/run/docker.sock
ALL_PROXY: "http://our.proxy.com:1234"
JAVA_OPTS: "-Dhttp.proxyHost=our.proxy.com -Dhttp.proxyPort=1234 -Dhttps.proxyHost=our.proxy.com -Dhttps.proxyPort=1234"
privileged: true
volumes:
jenkins-data:
FROM jenkins/jenkins:latest
USER root
ENV CURL_OPTIONS -k --proxy our.proxy.com:1234
If the runtime environment can't install plugins, then you can configure the plugins to be installed through a plugins.txt file in an environment that can access the update center.如果运行环境不能安装插件,那么可以在可以访问更新中心的环境中,通过plugins.txt文件配置要安装的插件。 Build the container image in an environment where the update center is available, then copy the image to the final destination.在更新中心可用的环境中构建容器镜像,然后将镜像复制到最终目的地。
One example is in https://github.com/MarkEWaite/docker-lfs/tree/lts-with-plugins where it stores the plugin binaries in the Git repository as large files and defines the precise plugin versions in the plugins.txt file.一个示例是在https://github.com/MarkEWaite/docker-lfs/tree/lts-with-plugins中,它将插件二进制文件存储在 Git 存储库中作为大文件,并在 plugins.txt 文件中定义精确的插件版本. The resulting container image includes the plugins so that access to the update center is not required.生成的容器映像包含插件,因此不需要访问更新中心。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.