-
-
Save orenitamar/f29fb15db3b0d13178c1c4dd611adce2 to your computer and use it in GitHub Desktop.
# Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib | |
# in an Alpine based Docker image. | |
FROM alpine:3.4 | |
RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories | |
RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev | |
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h | |
RUN pip install numpy scipy pandas matplotlib | |
Hi, can anyone help. I tried to execute the line in the Docker file but it takes very long to run .
Can anyone can help and what should i do ?
i didn't include panda version in my requirements - i tried but it run error . should i include and what version ? thanks
Pull a pre-built alpine docker image with nginx and python3 installed
FROM tiangolo/uwsgi-nginx-flask:python3.6-alpine3.7
ENV LISTEN_PORT=8000
EXPOSE 8000
COPY /app /app
RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
RUN pip install pandas
Thanks @orenitamar.
@mkdthanga: The following worked for me - I simply used python3-alpine build, and removed
python
,python-dev
andpy-pip
from the apk command (line 5, OP):FROM python:3-alpine WORKDIR /usr/source/app COPY requirements.txt ./ RUN apk update RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories RUN apk --no-cache --update-cache add gcc gfortran build-base wget freetype-dev libpng-dev openblas-dev RUN ln -s /usr/include/locale.h /usr/include/xlocale.h RUN pip install --no-cache-dir -r requirements.txt
This leads to ERROR: Failed building wheel for pyarrow
for me
@Frikster If you are using python:3-alpine
which means you prefer the latest python3.10
version, you could consider using package from alpine instead of from pip.
This way need python package from alpine!!!!
FROM alpine:3.16
RUN apk --no-cache --update-cache add python3 py3-pip py3-arrow py3-pandas # and py3-anything package need to be compiled
RUN pip install --no-cache-dir -r requirements.txt
=> ERROR [6/8] RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev 5.3s
[6/8] RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev:
nity/x86_64/APKINDEX.tar.gz
#11 5.137 WARNING: Ignoring http://dl-8.alpinelinux.org/alpine/edge/community: DNS lookup error
#11 5.215 ERROR: unable to select packages:
#11 5.252 python (no such package):
#11 5.252 required by: world[python]
#11 5.252 python-dev (no such package):
#11 5.252 required by: world[python-dev]
executor failed running [/bin/sh -c apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev]: exit code: 2
I am getting error like this pls can anyone help me out
In case you cant move to slim-buster, the natural answer to this is
pip install --extra-index-url https://alpine-wheels.github.io/index ...