Skip to content

Instantly share code, notes, and snippets.

@pythoninthegrass
Forked from orenitamar/Dockerfile
Last active March 22, 2024 05:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pythoninthegrass/789ed55097035406fb7d6916a7b3c618 to your computer and use it in GitHub Desktop.
Save pythoninthegrass/789ed55097035406fb7d6916a7b3c618 to your computer and use it in GitHub Desktop.
Installing numpy, scipy, pandas and matplotlib in Alpine (Docker)
# Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib
# in an Alpine based Docker image.
ARG VERSION=3.18
FROM alpine:${VERSION}
RUN apk update \
&& apk add \
--no-cache \
--repository http://dl-cdn.alpinelinux.org/x86_64/edge/community \
build-base \
curl \
freetype-dev \
gcc \
gfortran \
libpng-dev \
openblas-dev \
python3 \
python3-dev \
py3-pip \
py3-pandas \
py3-numpy \
wget
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
ENV PIP_DISABLE_PIP_VERSION_CHECK=on
ENV PIP_DEFAULT_TIMEOUT=100
RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,source=./requirements.txt,target=/app/requirements.txt \
python -m pip install --only-binary=1 numpy scipy pandas matplotlib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment