-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
91 lines (71 loc) · 2.59 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
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
FROM jupyter/pyspark-notebook
# For databrick flint
RUN \
git clone https://github.com/twosigma/flint.git && \
mkdir data && \
mkdir mne-tools
USER root
# For mne: https://github.com/mne-tools/mne-binder/blob/master/Dockerfile
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get -yq dist-upgrade \
&& apt-get install -yq --no-install-recommends \
openssh-client \
vim \
curl \
wget \
gcc \
&& apt-get clean
# Xvfb
RUN apt-get install -yq --no-install-recommends \
xvfb \
x11-utils \
libx11-dev \
qt5-default \
&& apt-get clean
# Downloaad sleep data from physionet.org: https://physionet.org/content/sleep-edfx/1.0.0/.
# File size ~8.1 G. The download process is slow. Disable it if you don't want to download the data.
RUN wget -r -N -c -np https://physionet.org/files/sleep-edfx/1.0.0/
ENV DISPLAY=:99
# Switch to notebook user
USER $NB_UID
# Upgrade the package managers
RUN pip install --upgrade pip
RUN npm i npm@latest -g
# Install Python packages
RUN pip install vtk && \
pip install boto && \
pip install h5py && \
pip install nose && \
pip install ipyevents && \
pip install ipywidgets && \
pip install mayavi && \
pip install nibabel && \
pip install numpy && \
pip install pillow && \
pip install pyqt5 && \
pip install scikit-learn && \
pip install scipy && \
pip install xvfbwrapper && \
pip install https://github.com/nipy/PySurfer/archive/master.zip && \
pip install https://codeload.github.com/mne-tools/mne-python/zip/master
# Install Jupyter notebook extensions
RUN pip install RISE && \
jupyter nbextension install rise --py --sys-prefix && \
jupyter nbextension enable rise --py --sys-prefix && \
jupyter nbextension install mayavi --py --sys-prefix && \
jupyter nbextension enable mayavi --py --sys-prefix && \
npm cache clean --force
# Download the MNE-sample dataset
RUN ipython -c "import mne; print(mne.datasets.sample.data_path(verbose=False))"
# Try to decrease initial IPython kernel load times
RUN ipython -c "import matplotlib.pyplot as plt; print(plt)"
WORKDIR "$HOME/mne-tools"
# Download and move ipynb notebooks
RUN git clone --depth=1 https://github.com/mne-tools/mne-tools.github.io && \
mv mne-tools.github.io/dev/_downloads/*/*.ipynb . && \
rm -Rf mne-tools.github.io
WORKDIR $HOME
# Configure the MNE raw browser window to use the full width of the notebook
RUN ipython -c "import mne; mne.set_config('MNE_BROWSE_RAW_SIZE', '9.8, 7')"
# Add an x-server to the entrypoint. This is needed by Mayavi
ENTRYPOINT ["tini", "-g", "--", "xvfb-run"]