Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 运行pip安装:确认ssl证书时出现问题:[ssl:certificate\u VERIFY\u FAILED]certificate VERIFY FAILED_Python_Docker_Ssl - Fatal编程技术网

Python 运行pip安装:确认ssl证书时出现问题:[ssl:certificate\u VERIFY\u FAILED]certificate VERIFY FAILED

Python 运行pip安装:确认ssl证书时出现问题:[ssl:certificate\u VERIFY\u FAILED]certificate VERIFY FAILED,python,docker,ssl,Python,Docker,Ssl,在[GitHub][1]的实验室中,为了了解更多关于Docker容器的信息,我遇到了以下问题: 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 cert

在[GitHub][1]的实验室中,为了了解更多关于Docker容器的信息,我遇到了以下问题:

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(一种防火墙)后面的网络有关,BlueCoat可以检查和隐藏我桌面和互联网上的几乎所有通信

在谷歌搜索失败后,我找到了忽略证书问题的命令:

只需将此添加到我的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"]