-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile-base
189 lines (164 loc) · 5.26 KB
/
Dockerfile-base
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
FROM debian:latest
MAINTAINER Tristan Salles
# install things
RUN apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
bash-completion \
build-essential \
git \
python3-minimal \
python3-dev \
python3-pip \
libxml2-dev \
xorg-dev \
ssh \
curl \
libfreetype6-dev \
libpng-dev \
libxft-dev \
xvfb \
freeglut3 \
freeglut3-dev \
libgl1-mesa-dri \
libgl1-mesa-glx \
python3-tk \
mesa-utils \
libavcodec-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
rsync \
vim \
less \
xauth \
swig \
gdb-minimal \
python3-dbg \
cmake \
python3-setuptools \
wget \
gfortran && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV LANG=C.UTF-8
# Install setuptools and wheel first, needed by plotly
RUN pip3 install -U setuptools && \
pip3 install -U wheel && \
pip3 install --no-cache-dir packaging \
appdirs \
numpy \
jupyter \
plotly \
matplotlib \
pillow \
pyvirtualdisplay \
ipython \
ipyparallel \
pint \
sphinx \
sphinx_rtd_theme \
sphinxcontrib-napoleon \
mock \
scipy \
tabulate \
scons
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.5 1
# Hack for scons.. should be able to remove in future.
ENV SCONS_LIB_DIR /usr/local/lib/python3.5/dist-packages/scons-3.0.1
# Hack for scons.. should be able to remove in future.
ENV SCONS_LIB_DIR /usr/local/lib/python3.5/dist-packages/scons-3.0.1
# install extras in a new layer
RUN pip3 install --no-cache-dir h5py \
tribad \
numpy>=1.15.0 \
h5py>=2.8.0 \
six>=1.11.0 \
setuptools>=38.4.0 \
pandas>=0.24 \
scipy>=1.2 \
scikit-image>=0.15 \
gFlex>=1.1.0 \
matplotlib>=3.0
# Install Tini.. this is required because CMD (below) doesn't play nice with notebooks for some reason: https://github.com/ipython/ipython/issues/7062, https://github.com/jupyter/notebook/issues/334
RUN curl -L https://github.com/krallin/tini/releases/download/v0.10.0/tini > tini && \
echo "1361527f39190a7338a0b434bd8c88ff7233ce7b9a4876f3315c22fce7eca1b0 *tini" | sha256sum -c - && \
mv tini /usr/local/bin/tini && \
chmod +x /usr/local/bin/tini
# expose notebook port
EXPOSE 8888
# expose lavavu port
EXPOSE 9999
# LavaVu stuff
# script for xvfb-run. all docker commands will effectively run under this via the entrypoint
RUN printf "#\041/bin/sh \n rm -f /tmp/.X99-lock && xvfb-run -s '-screen 0 1600x1200x16' \$@" >> /usr/local/bin/xvfbrun.sh && \
chmod +x /usr/local/bin/xvfbrun.sh
RUN git clone https://github.com/j08lue/pycpt.git && \
cd pycpt && \
git checkout b45f720d09da79bcd567c5cbba9a554b0a7cc1d9 && \
python3 setup.py install && \
cd .. && \
rm -rf pycpt
RUN apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
gmsh \
python3-gdal \
gdal-bin \
libgeos++ \
libgeos-dev \
libgdal-dev \
libproj-dev \
libproj-dev
RUN python3 -m pip install --no-cache-dir setuptools wheel && \
python3 -m pip install --no-cache-dir \
pathlib \
pandas \
descartes \
meshio \
shapely \
geopy \
rasterio \
pygeotools \
pygmsh \
meshplex \
ruamel.yaml \
stripy
# add default user jovyan and change permissions on NB_WORK
#ENV NB_USER jovyan
#RUN useradd -m -s /bin/bash -N jovyan
#USER $NB_USER
#ENV NB_WORK /workspace
# install extras in a new layer
RUN python3 -m pip install --no-cache-dir \
ipython \
jupyter \
lavavu \
scikit-fuzzy
RUN python3 -m pip install --no-cache-dir -U git+https://github.com/matplotlib/basemap.git
# Install Tini.. this is required because CMD (below) doesn't play nice with notebooks for some reason: https://github.com/ipython/ipython/issues/7062, https://github.com/jupyter/notebook/issues/334
RUN curl -L https://github.com/krallin/tini/releases/download/v0.10.0/tini > tini && \
echo "1361527f39190a7338a0b434bd8c88ff7233ce7b9a4876f3315c22fce7eca1b0 *tini" | sha256sum -c - && \
mv tini /usr/local/bin/tini && \
chmod +x /usr/local/bin/tini
# create a volume
RUN mkdir /live && \
mkdir /live/lib
VOLUME /live/share
WORKDIR /live
# LavaVu stuff
# script for xvfb-run. all docker commands will effectively run under this via the entrypoint
RUN printf "#\041/bin/sh \n rm -f /tmp/.X99-lock && xvfb-run -s '-screen 0 1600x1200x16' \$@" >> /usr/local/bin/xvfbrun.sh && \
chmod +x /usr/local/bin/xvfbrun.sh
# Add Tini
EXPOSE 8888
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/local/bin/tini
RUN chmod +x /usr/local/bin/tini
ENTRYPOINT ["/usr/local/bin/tini", "--"]
# expose LavaVu port
EXPOSE 9999
# note we use xvfb which to mimic the X display for lavavu
ENTRYPOINT ["/usr/local/bin/xvfbrun.sh"]
# launch notebook
ADD run-jupyter.sh /usr/local/bin/run-jupyter.sh
RUN chmod +x /usr/local/bin/run-jupyter.sh
CMD /usr/local/bin/run-jupyter.sh