I’m trying to build a docker with python 3 and google-cloud-bigquery with the following docker file:
FROM python:3.10-alpine
RUN pip3 install google-cloud-bigquery
WORKDIR /home
COPY *.py /home/
ENTRYPOINT ["python3", "-u", "myscript.py"]
But getting errors on the pip3 install google-cloud-bigquery
(too long for here)..
What’s missing for installing this on python-alpine?
2
Answers
Looks like an incompatibility issue with the latest version of google-cloud-bigquery (>3) and numpy:
Try specifying a previous version, this works for me:
Actually it seems like not a problem with
numpy
, which builds smoothly with all the dependency libs install, but rather withpyarrow
, which does not supportalpine+pip
build. I’ve found a workaround by using alpine pre-built version ofpyarrow
. It is much easier than building pyarrow from source. This build works for me just fine:Update
python
version,alpine
version andpy3-apache-arrow
version to install later versions. This is the latest one on the time of writing.And make sure to remove build dependencies (
build-base
,linux-headers
) for your release docker. I prefer multistage dockers for this.