I'm trying to build an image based on python:3-8.alpine
, using the python module asyncpg
.
Here is a part of my Dockerfile:
FROM python:3.8-alpine
RUN apk add gcc
RUN apk add python3-dev
RUN pip3 install asyncpg
I added gcc
and python3-dev
because I think I need them to be able to build asyncpg
according to the documentation : https://magicstack.github.io/asyncpg/current/installation.html (but i'm not sure of that, I think I should be able to install without building this module)
But I have the following error when building the image:
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
How can I solve this error and install asyncpg
?
Thanks