直到最近,我一直在使用openssl
docker映像中的python:3.6.6-jessie
库,并按预期工作。你知道吗
我使用非常基本的Dockerfile
配置来安装所有必要的依赖项:
FROM python:3.6.6-jessie
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
WORKDIR /code
RUN apt-get -qq update
RUN apt-get install openssl
RUN apt-get upgrade -y openssl
ADD requirements.txt /code/
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
并使用以下两行访问和初始化库本身:
openssl = cdll.LoadLibrary("libssl.so")
openssl.SSL_library_init()
用这种方法一切都很顺利。你知道吗
这周我正在升级python和库,结果我切换到了更新的docker映像:
FROM python:3.7.5
...
这立即导致openssl
停止工作,因为出现以下异常:
AttributeError: /usr/lib/x86_64-linux-gnu/libssl.so.1.1: undefined symbol: SSL_library_init
从这个错误我可以理解libssl
不再提供SSL_library_init
方法(或者看起来是这样),这是一个相当奇怪的问题,因为openssl
文档中的初始值设定项名称是相同的。你知道吗
我还尝试使用-stretch
和-buster
分布来解决这个问题,但问题仍然存在。你知道吗
在那些较新的发行版中运行SSL_library_init
的正确方法是什么?可能需要一些额外的dockerfile配置?你知道吗
我想你需要安装
libssl1.0-dev
相关问题 更多 >
编程相关推荐