Docker Alpine映像构建挂起在matplotlib上

Docker Alpine映像构建挂起在matplotlib上,docker,matplotlib,alpine,Docker,Matplotlib,Alpine,我敢肯定这在几周前起作用了。我无法再在Alpine基础映像上安装matplotlib。我的Dockerfile的精简版本是: FROM python:3-alpine RUN apk add --no-cache --virtual .build-deps \ zlib-dev jpeg-dev musl-dev linux-headers build-base g++ python3-dev py3-setuptools libffi-dev cmd:pip3 \ &

我敢肯定这在几周前起作用了。我无法再在Alpine基础映像上安装matplotlib。我的Dockerfile的精简版本是:

FROM python:3-alpine

RUN apk add --no-cache --virtual .build-deps \
    zlib-dev jpeg-dev musl-dev linux-headers build-base g++ python3-dev py3-setuptools libffi-dev cmd:pip3 \
    && pip3 install --no-cache-dir \
    matplotlib mplfinance
这项工程仍在继续

...
(53/55) Installing py3-toml (0.10.2-r0)
(54/55) Installing py3-pip (20.3.4-r0)
(55/55) Installing .build-deps (20210525.060427)
Executing busybox-1.32.1-r6.trigger
OK: 318 MiB in 91 packages
Collecting matplotlib
  Downloading matplotlib-3.4.2.tar.gz (37.3 MB) **<- This never completes**
slim没有问题

当我尝试在谷歌云上构建时,也会发生完全相同的行为

gcloud builds submit . --tag=$GCR_TAG

我尝试了各种组合,去掉了
--no cache
--no cache dir
,但这没有什么区别

只是好奇,为什么要使用docker?既然这更简单,为什么不直接使用python venv呢?
“我肯定这在几周前就可以用了。”
。。。只是在黑暗中拍摄:您是否能够指定matplotlib 3.4.1?如果是这样的话,这样做有效吗?(注意:3.4.2仅在几周前发布)。我使用docker,因为该服务是API的一部分。同样感谢3.4.1的建议,我试过了,得到了同样的结果
gcloud builds submit . --tag=$GCR_TAG