python:3-8.alpine
我正在尝试使用 python 模块构建基于 的图像asyncpg
。
这是我的 Dockerfile 的一部分:
FROM python:3.8-alpine
RUN apk add gcc
RUN apk add python3-dev
RUN pip3 install asyncpg
我添加了gcc
,python3-dev
因为我认为我需要它们能够asyncpg
根据文档进行构建:https ://magicstack.github.io/asyncpg/current/installation.html (但我不确定,我想我应该无需构建此模块即可安装)
但是在构建图像时出现以下错误:
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/local/include/python3.8 -c asyncpg/pgproto/pgproto.c -o build/temp.linux-x86_64-3.8/asyncpg/pgproto/pgproto.o -O2 -fsigned-char -Wall -Wsign-compare -Wconversion
In file included from asyncpg/pgproto/pgproto.c:29:
/usr/local/include/python3.8/Python.h:11:10: fatal error: limits.h: No such file or directory
11 | #include <limits.h>
| ^~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
如何解决此错误并安装asyncpg
?
谢谢