-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
60 lines (57 loc) · 2.14 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM alpine:latest
MAINTAINER Feng Zheng
# installs Python 3 and pip
RUN apk add --no-cache python3 && \
if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python ; fi && \
\
python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip3 install --no-cache --upgrade pip setuptools wheel && \
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi
# installs data science packages
RUN apk add --no-cache \
--virtual=.build-dependencies \
g++ gcc gfortran file binutils \
musl-dev python3-dev cython \
openblas-dev postgresql-dev && \
apk add --no-cache make libstdc++ openblas openssh-client git bash linux-headers openssl postgresql-libs && \
\
ln -s locale.h /usr/include/xlocale.h && \
\
pip install --upgrade cython && \
pip install psycopg2 && \
pip install numpy && \
pip install pandas && \
pip install scipy && \
pip install scikit-learn && \
\
rm -r /root/.cache && \
find /usr/lib/python3.*/ -name 'tests' -exec rm -r '{}' + && \
find /usr/lib/python3.*/site-packages/ -name '*.so' -print -exec sh -c 'file "{}" | grep -q "not stripped" && strip -s "{}"' \; && \
\
rm /usr/include/xlocale.h && \
\
apk del .build-dependencies
# Add pycddlib and cvxopt with GLPK
RUN cd /tmp && \
apk add --no-cache \
--virtual=.build-dependencies \
gcc make file binutils \
musl-dev python3-dev cython gmp-dev suitesparse-dev openblas-dev && \
apk add gmp suitesparse && \
\
pip install pycddlib && \
\
wget "ftp://ftp.gnu.org/gnu/glpk/glpk-4.65.tar.gz" && \
tar xzf "glpk-4.65.tar.gz" && \
cd "glpk-4.65" && \
./configure --disable-static && \
make -j4 && \
make install-strip && \
CVXOPT_BLAS_LIB=openblas CVXOPT_LAPACK_LIB=openblas CVXOPT_BUILD_GLPK=1 pip install --global-option=build_ext --global-option="-I/usr/include/suitesparse" cvxopt && \
\
rm -r /root/.cache && \
find /usr/lib/python3.*/site-packages/ -name '*.so' -print -exec sh -c 'file "{}" | grep -q "not stripped" && strip -s "{}"' \; && \
\
apk del .build-dependencies && \
rm -rf /tmp/*