|
6 | 6 | # the above mentioned dockerfiles. For more information see:
|
7 | 7 | # https://github.com/miykael/nipype_env
|
8 | 8 |
|
9 |
| -FROM jupyter/base-notebook |
| 9 | +FROM miykael/nipype_level1 |
10 | 10 | MAINTAINER Michael Notter <michaelnotter@hotmail.com>
|
11 | 11 |
|
12 |
| -# Switch to root user for installation |
13 |
| -USER root |
14 |
| - |
15 |
| -#--------------------------------------------- |
16 |
| -# Update OS dependencies and setup neurodebian |
17 |
| -#--------------------------------------------- |
18 |
| -USER root |
19 |
| -RUN apt-get update && \ |
20 |
| - apt-get install -yq --no-install-recommends bzip2 \ |
21 |
| - ca-certificates \ |
22 |
| - curl \ |
23 |
| - git \ |
24 |
| - tree \ |
25 |
| - unzip \ |
26 |
| - wget \ |
27 |
| - xvfb \ |
28 |
| - zip |
29 |
| -ENV NEURODEBIAN_URL http://neuro.debian.net/lists/jessie.de-md.full |
30 |
| -RUN curl -sSL $NEURODEBIAN_URL | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list && \ |
31 |
| - apt-key adv --recv-keys --keyserver hkp://pgp.mit.edu:80 0xA5D32F012649A5A9 && \ |
32 |
| - apt-get update -qq |
33 |
| - |
34 |
| -#--------------------- |
35 |
| -# Install FSL and AFNI |
36 |
| -#--------------------- |
37 |
| -USER root |
38 |
| -RUN apt-get update && \ |
39 |
| - apt-get install -y -qq --no-install-recommends fsl-core fsl-atlases afni |
40 |
| -ENV FSLDIR=/usr/share/fsl/5.0 \ |
41 |
| - FSLOUTPUTTYPE=NIFTI_GZ \ |
42 |
| - FSLMULTIFILEQUIT=TRUE \ |
43 |
| - POSSUMDIR=/usr/share/fsl/5.0 \ |
44 |
| - LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH \ |
45 |
| - FSLTCLSH=/usr/bin/tclsh \ |
46 |
| - FSLWISH=/usr/bin/wish \ |
47 |
| - AFNI_MODELPATH=/usr/lib/afni/models \ |
48 |
| - AFNI_IMSAVE_WARNINGS=NO \ |
49 |
| - AFNI_TTATLAS_DATASET=/usr/share/afni/atlases \ |
50 |
| - AFNI_PLUGINPATH=/usr/lib/afni/plugins \ |
51 |
| - PATH=/usr/lib/fsl/5.0:/usr/lib/afni/bin:$PATH |
| 12 | +#------------------------- |
| 13 | +# Your Docker Instructions |
| 14 | +#------------------------- |
52 | 15 |
|
53 |
| -#----------------------------------------------------------------------- |
54 |
| -# Update and install conda dependencies for python2.7 (including nipype) |
55 |
| -#----------------------------------------------------------------------- |
56 |
| -USER $NB_USER |
| 16 | +# <-- Change the level above (under FROM) --> |
57 | 17 |
|
58 |
| -# Make sure that necessary packages are installed |
59 |
| -RUN conda create -yq -n python2 python=2.7 ipython \ |
60 |
| - pip \ |
61 |
| - jupyter \ |
62 |
| - notebook \ |
63 |
| - nb_conda \ |
64 |
| - nb_conda_kernels \ |
65 |
| - nilearn \ |
66 |
| - matplotlib \ |
67 |
| - graphviz \ |
68 |
| - pandas \ |
69 |
| - seaborn \ |
70 |
| - nipype && \ |
71 |
| - conda clean -tipsy |
| 18 | +# <-- Put your docker instructions here --> |
72 | 19 |
|
73 |
| -# Make sure that Python2 is loaded before Python3 |
74 |
| -ENV PATH=/opt/conda/envs/python2/bin:$PATH |
75 | 20 |
|
76 |
| -# Import matplotlib the first time to build the font cache. |
77 |
| -ENV XDG_CACHE_HOME /home/$NB_USER/.cache/ |
78 |
| -RUN MPLBACKEND=Agg $CONDA_DIR/envs/python2/bin/python -c "import matplotlib.pyplot" |
| 21 | +#------------------------------------------ |
| 22 | +# Copy Tutorial Notebooks into Docker Image |
| 23 | +#------------------------------------------ |
| 24 | +USER root |
| 25 | +COPY index.ipynb /home/$NB_USER/work/index.ipynb |
| 26 | +COPY notebooks /home/$NB_USER/work/notebooks |
| 27 | +COPY static /home/$NB_USER/work/static |
79 | 28 |
|
80 |
| -# Activate ipywidgets extension in the environment that runs the notebook server |
81 |
| -RUN jupyter nbextension enable --py widgetsnbextension --sys-prefix |
82 | 29 |
|
83 |
| -# Install Python 2 kernel spec globally to avoid permission problems when NB_UID |
84 |
| -# switching at runtime and to allow the notebook server running out of the root |
85 |
| -# environment to find it. Also, activate the python2 environment upon kernel |
86 |
| -# launch. |
| 30 | +#------------------------------------------------ |
| 31 | +# Create /output folder and give power to NB_USER |
| 32 | +#------------------------------------------------ |
87 | 33 | USER root
|
88 |
| -RUN pip install kernda --no-cache && \ |
89 |
| - $CONDA_DIR/envs/python2/bin/python -m ipykernel install && \ |
90 |
| - kernda -o -y /usr/local/share/jupyter/kernels/python2/kernel.json && \ |
91 |
| - pip uninstall kernda -y |
| 34 | +RUN mkdir -p /output |
| 35 | +RUN chown -R $NB_USER:users /home/$NB_USER && \ |
| 36 | + chown -R $NB_USER:users /output |
92 | 37 |
|
93 |
| -#--------------------------------------------- |
94 |
| -# Install graphviz and update pip dependencies |
95 |
| -#--------------------------------------------- |
96 |
| -USER root |
97 |
| -RUN apt-get install -yq --no-install-recommends graphviz |
| 38 | +# Set default user to NB_USER |
98 | 39 | USER $NB_USER
|
99 |
| -RUN pip install --upgrade --quiet pip && \ |
100 |
| - pip install --upgrade --quiet nipy \ |
101 |
| - rdflib \ |
102 |
| - --ignore-installed && \ |
103 |
| - rm -rf ~/.cache/pip |
104 |
| - |
105 |
| -#---------------------------------------- |
106 |
| -# Clear apt cache and other empty folders |
107 |
| -#---------------------------------------- |
108 |
| -USER root |
109 |
| -RUN apt-get clean && \ |
110 |
| - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /boot /media /mnt /srv |
0 commit comments