尝试停靠Django应用,Docker找不到ft2build.h

n9vozmp4  于 2022-11-22  发布在  Docker
关注(0)|答案(1)|浏览(175)

我是Docker的新手,我正在尝试停靠Django应用程序,但当我运行docker build -t sometag .时,我收到了以下错误:

#9 23.05   Preparing metadata (setup.py): started
#9 23.32   Preparing metadata (setup.py): finished with status 'error'
#9 23.33   error: subprocess-exited-with-error
#9 23.33
#9 23.33   × python setup.py egg_info did not run successfully.
#9 23.33   │ exit code: 1
#9 23.33   ╰─> [10 lines of output]
#9 23.33       ##### setup-python-3.10.8-linux-x86_64: ================================================
#9 23.33       ##### setup-python-3.10.8-linux-x86_64: Attempting build of _rl_accel
#9 23.33       ##### setup-python-3.10.8-linux-x86_64: extensions from 'src/rl_addons/rl_accel'
#9 23.33       ##### setup-python-3.10.8-linux-x86_64: ================================================
#9 23.33       ##### setup-python-3.10.8-linux-x86_64: ===================================================
#9 23.33       ##### setup-python-3.10.8-linux-x86_64: Attempting build of _renderPM
#9 23.33       ##### setup-python-3.10.8-linux-x86_64: extensions from 'src/rl_addons/renderPM'
#9 23.33       ##### setup-python-3.10.8-linux-x86_64: ===================================================
#9 23.33       ##### setup-python-3.10.8-linux-x86_64: will use package libart 2.3.21
#9 23.33       !!!!! cannot find ft2build.h
#9 23.33       [end of output]
#9 23.33
#9 23.33   note: This error originates from a subprocess, and is likely not a problem with pip.
#9 23.33 error: metadata-generation-failed
#9 23.33
#9 23.33 × Encountered error while generating package metadata.
#9 23.33 ╰─> See above for output.
#9 23.33
#9 23.33 note: This is an issue with the package mentioned above, not pip.
#9 23.33 hint: See above for details.
------
executor failed running [/bin/sh -c pip install -r requirements.txt]: exit code: 1

我不确定它是否与ft2build.h.I有关。我是否在我的dockerfile中丢失了一些内容?
这是我的要求.txt:

arabic-reshaper==2.1.3
asn1crypto==1.5.1
attrs==20.3.0
azure-core==1.23.1
azure-storage-blob==12.11.0
certifi==2021.10.8
cffi==1.15.0
charset-normalizer==2.0.12
click==8.1.2
colorama==0.4.4
cryptography==36.0.2
cssselect2==0.5.0
distlib==0.3.5
Django==4.0.3
django-crispy-forms==1.14.0
django-storages==1.12.3
djangorestframework==3.14.0
filelock==3.8.0
future==0.18.2
html5lib==1.1
idna==3.3
isodate==0.6.1
jellyfish==0.9.0
lib50==3.0.4
lxml==4.8.0
markdown2==2.4.2
msrest==0.6.21
oauthlib==3.2.0
oscrypto==1.3.0
pexpect==4.8.0
Pillow==9.1.0
platformdirs==2.5.2
psycopg2-binary==2.9.3
ptyprocess==0.7.0
pycparser==2.21
pyHanko==0.12.1
pyhanko-certvalidator==0.19.5
PyPDF2==1.27.3
PyPDF3==1.0.6
python-bidi==0.4.2
pytz==2022.1
PyYAML==5.4.1
qrcode==7.3.1
reportlab==3.6.9
requests==2.27.1
requests-oauthlib==1.3.1
six==1.16.0
submit50==3.1.1
svglib==1.2.1
termcolor==1.1.0
tinycss2==1.1.1
tk==0.1.0
tqdm==4.64.0
typing_extensions==4.1.1
tzdata==2022.1
tzlocal==4.2
uritools==4.0.0
urllib3==1.26.9
virtualenv==20.16.3
webencodings==0.5.1
whitenoise==6.0.0
xhtml2pdf==0.2.7

注意:我不得不删除dockerfile,因为Stackoverflow不允许我发布这么多代码,但我运行的是RUN apk update \&& apk add --no-cache gcc musl-dev postgresql-dev python3-dev libffi-dev \&& pip install --upgrade pip

92dk7w1h

92dk7w1h1#

我不确定它是否与ft2build.h.I有关。我是否在我的dockerfile中丢失了一些内容?
要解决编译过程中的ft2build.h.错误问题,需要安装freetype库
我假设您使用的是Alpine的最新版本,我可以看到您可以安装pip包没有问题。
因此,缺少的部分应该是要安装的freetype-dev包。

RUN apk update \ 
 && apk add --no-cache gcc musl-dev postgresql-dev python3-dev libffi-dev freetype-dev\

相关问题