- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
已解决 哇,这些家伙真快……基本上就是这个https://github.com/pyca/cryptography/issues/2750事实证明,openssl 的安全更新已发布(DROWN 攻击),该更新包含意外的函数签名更改,导致不兼容,所以这对我来说只是运气不好。
我需要在运行 Alpine Linux 的 Docker 容器中使用 pip install cryptography
。实际上,它是另一个模块,service_identity
,但问题出在 cryptography
模块,这是一个依赖。
我有以下 Dockerfile
FROM alpine:3.3
RUN apk --update add build-base libffi-dev openssl-dev python-dev py-pip
RUN pip install cryptography
失败并出现以下错误
generating cffi module 'build/temp.linux-x86_64-2.7/_openssl.c'
building '_openssl' extension
creating build/temp.linux-x86_64-2.7/build
creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
gcc -fno-strict-aliasing -Os -fomit-frame-pointer -DNDEBUG -Os -fomit-frame-pointer -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_openssl.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o
build/temp.linux-x86_64-2.7/_openssl.c:726:6: error: conflicting types for 'BIO_new_mem_buf'
BIO *BIO_new_mem_buf(void *, int);
^
In file included from /usr/include/openssl/asn1.h:65:0,
from build/temp.linux-x86_64-2.7/_openssl.c:434:
/usr/include/openssl/bio.h:692:6: note: previous declaration of 'BIO_new_mem_buf' was here
BIO *BIO_new_mem_buf(const void *buf, int len);
^
error: command 'gcc' failed with exit status 1
openssl 1.0.2g 于 2016-03-01(昨天)发布,并且 alpine 包已经更新到该版本。会不会跟这个有关?
我该如何解决这个问题?也许我可以设置一些环境变量?
更新 我一直在检查 GitHub Repo 中的 openssl,实际上是 openssl/bio 的
在 1.0.2f 到 1.0.2g 的过渡期间更改为 BIO *BIO_new_mem_buf(void *buf, int len)
.hBIO *BIO_new_mem_buf(const void *buf, int len)
(在 https://github.com/openssl/openssl/compare/OpenSSL_1_0_2f...OpenSSL_1_0_2g 中搜索“BIO_new_mem_buf”)。我不知道这个 openssl/asn1.h
是从哪里来的,它正在导入一个过时版本的 openssl/bio.h
,因为它看起来不像openssl 仓库中的一个。有什么想法吗?
好的,我看到有些人已经在着手解决这个问题: https://github.com/pyca/cryptography/issues/2750
最佳答案
对于那些在 Alpine 3.7 中安装 cryptography==2.1.4
仍然遇到问题的人,如下所示:
writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
running build_ext
generating cffi module 'build/temp.linux-x86_64-2.7/_padding.c'
creating build/temp.linux-x86_64-2.7
generating cffi module 'build/temp.linux-x86_64-2.7/_constant_time.c'
generating cffi module 'build/temp.linux-x86_64-2.7/_openssl.c'
building '_openssl' extension
creating build/temp.linux-x86_64-2.7/build
creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
gcc -fno-strict-aliasing -Os -fomit-frame-pointer -g -DNDEBUG -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_openssl.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o -Wconversion -Wno-error=sign-conversion
build/temp.linux-x86_64-2.7/_openssl.c:493:30: fatal error: openssl/opensslv.h: No such file or directory
#include <openssl/opensslv.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
在 Alpine 容器中安装这些依赖项:
$ apk add --no-cache libressl-dev musl-dev libffi-dev
要使用 Dockerfile 安装这些依赖项:
RUN apk add --no-cache \
libressl-dev \
musl-dev \
libffi-dev && \
pip install --no-cache-dir cryptography==2.1.4 && \
apk del \
libressl-dev \
musl-dev \
libffi-dev
Alpine 上cryptography
的安装说明可以在这里找到:
相关部分如下:
Building cryptography on Linux
[skipping over the part for non-Alpine Linux] …
$ pip install cryptography
If you are on Alpine or just want to compile it yourself then
cryptography
requires a compiler, headers for Python (if you're not usingpypy
), and headers for the OpenSSL andlibffi
libraries available on your system.Alpine
Replace
python3-dev
withpython-dev
if you're using Python 2.$ sudo apk add gcc musl-dev python3-dev libffi-dev openssl-dev
If you get an error with
openssl-dev
you may have to uselibressl-dev
.
关于python - 在 Docker Alpine Linux 3.3 中无法使用 OpenSSL 1.0.2g 和 Python 2.7 出现 "pip install cryptography",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35736598/
所以最近(9 月 5 日)Alpine Linux 软件包仓库更新为 postgresql-client 12.4 我在我的 Dockerfile ( apk add postgresql-clien
当我运行 apk add --update ab 时出现错误: bash-4.3# apk add --update ab fetch http://dl-cdn.alpinelinux.org/al
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 9 个月前关闭。 Improve t
我有一个在 Alpine 发行版上运行的 docker 镜像,为了让我的一个要求工作 - pocketsphinx==0.1.15,我必须在我的 DockerFile 中安装一些依赖项: FROM p
我已按照以下步骤创建自定义 rootfs 镜像以使用 firecracker 启动:- https://github.com/firecracker-microvm/firecracker/blob/
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
我正在使用 alpine(最低 3.5)并且我需要使用 nodeJS 4.8.4 Docker 文件 FROM alpine:3.5 RUN apk add --update nodejs=4.8.4
使用 ruby-2.6.6-alpine 的 Docker 镜像创建了一个 498mb 的镜像大小。但是,当我降级到 ruby-2.6.5-alpine 时,它又回到了 266mb。 2.
我尝试在php:7.0-fpm-alpine上安装bz2扩展(基于Alpine 3.4): FROM php:7.0-fpm-alpine RUN docker-php-ext-install bz2
1、运行 fonts ,打开字体文件夹,找到要用的字体文件; 2、修改Dockerfile,例如: ?
我有这个Dockerfile ... FROM keymetrics/pm2:latest-alpine RUN apk update && \ apk upgrade && \ ap
我已经阅读了很多有关Docker容器和Unikernel的知识,以及如何在自己的应用程序中运行轻量级环境。 我知道Linux容器和Unikernel是不同的东西,因为第一个是内核功能(例如 names
我有一个 docker 镜像 nginx:stable-alpine,我需要使用 nginx-extras 为了使用 rewrite_by_lua指示。 我尝试通过 apk add --cached
堆高车 我正在使用Docker容器化我的应用程序。在下面的stage中,我尝试使用UPX对其进行打包。 FROM alpine:3.8 AS compressor # Version of upx t
我在CI / CD机器上使用Alpine linux。下面的docker文件: FROM node:10.15-alpine RUN npm i -g sequelize sequelize-cli
我正在尝试使用 The Badass Runtime Plugin 创建自定义运行时图像然后在 Alpine 上执行它。但它失败并显示以下错误消息。 jibcmd_1 | /bin/sh: exec
如何为所有语言安装字体?这是我的工作,但是Chrome中没有日语字体。 从此图像:https://github.com/Zenika/alpine-chrome/blob/master/Dockerf
是否可以在 Alpine Linux 中的 less 命令上启用鼠标滚动? 我尝试过使用 export LESS=-R 但没有任何作用。 最佳答案 Alpine 上默认的 less 由 BusyBox
我正在尝试在 alpine 中安装一个包,在本例中我指定了“jasper-dev”,但我和其他许多人都遇到过这种情况。我在终端中得到的输出是: / # apk add jasper-dev ERROR
当尝试安装 pdftk apk 时抛出此错误。 ERROR: unsatisfiable constraints: pdftk (missing): required by: world[
我是一名优秀的程序员,十分优秀!