gpt4 book ai didi

python - 在Docker上的pip安装上的CERTIFICATE_VERIFY_FAILED

转载 作者:行者123 更新时间:2023-12-02 19:51:02 24 4
gpt4 key购买 nike

我有一个容器化的Python应用程序和一个基于官方Python镜像的简单Dockerfile:

FROM python:3.8.2

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1


# Create /app directory, cd and copy app code there
RUN mkdir /code
WORKDIR /code
COPY . /code/

# Install uWSGI
RUN pip install uwsgi

# Install pipenv and dependencies
RUN pip install pipenv
RUN pipenv install

它已经运行了一段时间,但是自从本周以来,我无法运行构建:
> docker build .
Sending build context to Docker daemon 78.7MB
Step 1/9 : FROM python:3.8.2
---> f88b2f81f83a
Step 2/9 : ENV PYTHONDONTWRITEBYTECODE 1
---> Using cache
---> 45d957e47769
Step 3/9 : ENV PYTHONUNBUFFERED 1
---> Using cache
---> 6b4a2895d407
Step 4/9 : RUN mkdir /code
---> Using cache
---> b62fa947f323
Step 5/9 : WORKDIR /code
---> Using cache
---> 36c69f0e2ccf
Step 6/9 : COPY . /code/
---> a17cd24bfae2
Step 7/9 : RUN pip install uwsgi
---> Running in 888bec573d6b
Collecting uwsgi
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VER
IFY_FAILED] certificate verify failed: certificate is not yet valid (_ssl.c:1108)'))': /packages/e7/1e/3dcca007f974fe4eb369bf1b8629d5e342bb3055e2001b2e5340aaefae7a/uwsgi-2.0.18.
tar.gz
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VER
IFY_FAILED] certificate verify failed: certificate is not yet valid (_ssl.c:1108)'))': /packages/e7/1e/3dcca007f974fe4eb369bf1b8629d5e342bb3055e2001b2e5340aaefae7a/uwsgi-2.0.18.
tar.gz
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VER
IFY_FAILED] certificate verify failed: certificate is not yet valid (_ssl.c:1108)'))': /packages/e7/1e/3dcca007f974fe4eb369bf1b8629d5e342bb3055e2001b2e5340aaefae7a/uwsgi-2.0.18.
tar.gz

我正在Windows机器上运行此程序,但是我的容器在Linux上。

我找到了一种使用 --trusted-host files.pythonhosted.org的解决方案,但是信任HTTP上的下载代码似乎不太正确,我宁愿正确使用证书。但是我对证书不是很好,甚至在Docker镜像中也是如此。

有什么帮助吗?

最佳答案

经过数小时的证书摆弄和思考--trusted-host解决方法后,我终于找到了对我有用的东西:

将Docker Desktop(适用于Windows)更新到版本2.2.0.4(最新),并且一切再次正常运行...

我不确定为什么会这样,所以仍然欢迎您提出想法!

关于python - 在Docker上的pip安装上的CERTIFICATE_VERIFY_FAILED,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60674509/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com