本文介绍了RUN pip安装:确认ssl证书时出现问题:[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在[GitHub] [1]进行实验之后,我了解了有关Docker容器的更多信息:

Following the lab from [GitHub][1] to learn more about Docker containers, I felt in this problem:

No matching distribution found for Flask==0.10.1 (from -r /usr/src/app/requirements.txt (line 1))
  Could not fetch URL https://pypi.python.org/simple/flask/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726) - skipping```


  [1]: https://github.com/docker/labs/blob/master/beginner/chapters/webapps.md

推荐答案

问题与以下事实有关:我在BlueCoat(一种防火墙)后面的网络中,该网络检查并隐藏了我桌面上的几乎所有通信和互联网.

The problem is related to the fact that I'm in a network behind a BlueCoat (kind of firewall) which inspect and hide almost of the communication from my desktop and the internet.

在Google搜索失败后,我发现了忽略证书问题的命令:

After fell googles seach I've found the command to ignore the certificat problem:

只需将其添加到我的dockerfile-trusted-host pypi.org --trusted-host pypi.python.org --trusted-host = files.pythonhosted.org

Just add this to my dockerfile--trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org

# our base image
FROM alpine:3.5

# Install python and pip
RUN apk add --update py2-pip

# install Python modules needed by the Python app
COPY requirements.txt /usr/src/app/
RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org --no-cache-dir -r /usr/src/app/requirements.txt

# copy files required for the app to run
COPY app.py /usr/src/app/
COPY templates/index.html /usr/src/app/templates/

# tell the port number the container should expose
EXPOSE 5000

# run the application
CMD ["python", "/usr/src/app/app.py"]

这篇关于RUN pip安装:确认ssl证书时出现问题:[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-27 22:24