SSL:CERTIFICATE_VERIFY_FAILED 证书验证失败(_ssl.c:852)

SSL:CERTIFICATE_VERIFY_FAILED 证书验证失败(_ssl.c:852)

y-ppa-manager下面是我用于包安装的Dockerfile 。

FROM ubuntu:18.04

RUN add-apt-repository ppa:webupd8team/y-ppa-manager
RUN apt-get update -y
RUN apt-get install -y y-ppa-manager

但是在 docker 镜像构建期间,它会失败并出现以下错误。

RUN add-apt-repository ppa:webupd8team/y-ppa-manager
---> Running in 2474e6f3252a
Y PPA Manager

Info: http://www.webupd8.org/2010/11/y-ppa-manager-easily-search-add-remove.html

This PPA is for Y PPA Manager and also includes the latest YAD for the supported Ubuntu versions (YAD is a dependency for Y PPA Manager): http://sourceforge.net/p/yad-dialog/
More info: https://launchpad.net/~webupd8team/+archive/ubuntu/y-ppa-manager
'Error reading https://keyserver.ubuntu.com/pks/lookup?op=get&options=mr&exact=on&search=0x7B2C3B0889BF5709A105D03AC2518248EEA14886: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'
The command '/bin/sh -c add-apt-repository ppa:webupd8team/y-ppa-manager' returned a non-zero code: 1

对于此错误,[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)已在主机上安装了公司代理证书。

我必须在容器内添加证书吗?

知道我这里遗漏了什么吗?任何帮助都会有帮助。谢谢。

答案1

我尝试使用以下内容重现您的问题Dockerfile

FROM ubuntu:18.04

# If you need a proxy server e.g. at 192.168.0.1:3128
#RUN echo 'Acquire::http::proxy "http://192.168.0.1:3128/";' > /etc/apt/apt.conf.d/05proxy
#RUN echo 'Acquire::https::proxy "http://192.168.0.1:3128/";' >> /etc/apt/apt.conf.d/05proxy

RUN apt-get update
RUN apt-get install --no-install-recommends --yes software-properties-common

# Add the local proxy certificate inside container
ADD Proxy-Certificate.crt /usr/local/share/ca-certificates/Proxy-Certificate.crt 
RUN update-ca-certificates

RUN add-apt-repository ppa:webupd8team/y-ppa-manager
RUN apt-get update
RUN apt-get install --yes y-ppa-manager
...

0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
--> d62ad9911de
STEP 4/6: RUN add-apt-repository ppa:webupd8team/y-ppa-manager
 Y PPA Manager

Info: http://www.webupd8.org/2010/11/y-ppa-manager-easily-search-add-remove.html

This PPA is for Y PPA Manager and also includes the latest YAD for the supported Ubuntu versions (YAD is a dependency for Y PPA Manager): http://sourceforge.net/p/yad-dialog/
 More info: https://launchpad.net/~webupd8team/+archive/ubuntu/y-ppa-manager
Get:1 http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu bionic InRelease [15.4 kB]
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease

...

而且它起作用了...有可能您没有使用官方基础图像ubuntu:18.04吗?

相关内容