我正在Heroku中运行一个Django Python项目,为了支持Python加密包,我的dockerfile包含了关于首先安装该包的非Python依赖项的说明:
run apk add openssl-dev cargo
然后,我的构建日志显示,部署构建了各种车轮。密码转轮需要几分钟的时间来构建:
Building wheel for cryptography (PEP 517): started
Building wheel for cryptography (PEP 517): still running...
Building wheel for cryptography (PEP 517): still running...
Building wheel for cryptography (PEP 517): finished with status 'done'
Created wheel for cryptography: filename=cryptography-3.4.7-cp38-cp38-linux_x86_64.whl size=534047 sha256=8c3212278fa23bad7ecfbc54d036e8d35ba9308479d87e8ec39697aed26095dc
是否有任何预编译轮或构建包或类似的东西可以用于更快地加快部署?
发布于 2021-09-27 04:58:18
根据您的apk
命令,您可能正在运行Alpine。阿尔卑斯使用musl
作为其libc
实现,这在历史上阻止了cryptography
项目上传二进制文件。但是,随着PEP 656的接受(以及对audit轮、pypa/manylinux容器和pypa/仓库允许上传的大量后续工作),我们现在可以上传musllinux
车轮了。cryptography
在2021年9月19日上传了一个用于密码学3.4.8 (x86_64 arch)的轮子。
要得到这个轮子,有两个先决条件:
pip
。没有比21.2.4版本更早的版本支持musllinux
轮子。如果您满足这些要求,那么pip install cryptography
将不再需要高寒上的编译器(铁锈或gcc/clang)。
https://stackoverflow.com/questions/69318121
复制相似问题