我正在尝试在基于Alpine 3.1的docker容器中安装numpy。我正在使用以下Dockerfile:
FROM alpine:3.1 RUN apk add --update make cmake gcc g++ gfortran RUN apk add --update python py-pip python-dev RUN pip install cython RUN pip install numpy
直到pip install numpy出现以下错误,此方法运行良好:
pip install numpy
error: Command "gcc -fno-strict-aliasing -Os -fomit-frame-pointer -DNDEBUG -Os -fomit-frame-pointer -fPIC -Inumpy/core/include -Ibuild/src.linux-x86_64-2.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python2.7 -Ibuild/src.linux-x86_64-2.7/numpy/core/src/private -Ibuild/src.linux-x86_64-2.7/numpy/core/src/private -Ibuild/src.linux-x86_64-2.7/numpy/core/src/private -c build/src.linux-x86_64-2.7/numpy/core/src/npymath/ieee754.c -o build/temp.linux-x86_64-2.7/build/src.linux-x86_64-2.7/numpy/core/src/npymath/ieee754.o" failed with exit status 1
easy_install-2.7 numpy 给出相同的错误。
easy_install-2.7 numpy
我缺少任何配置/安装步骤吗?
如果你没有必要需要安装numpy的pypi,你可以从高山仓库安装它。包已命名py- numpy且位于testing存储库中,请参见此处。Dockerfile对我有用的最小示例
numpy
pypi
py- numpy
testing
Dockerfile
FROM alpine:3.2 ADD repositories /etc/apk/repositories RUN apk add --update python python-dev gfortran py-pip build-base py-numpy@community
repositories文件内容
repositories
http://dl-cdn.alpinelinux.org/alpine/v3.2/main @community http://dl-cdn.alpinelinux.org/alpine/edge/community