Skip to content

Commit 7173934

Browse files
committed
ENH: updated Dockerfile
1 parent 383dd44 commit 7173934

File tree

2 files changed

+21
-92
lines changed

2 files changed

+21
-92
lines changed

Dockerfile

Lines changed: 20 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -6,105 +6,34 @@
66
# the above mentioned dockerfiles. For more information see:
77
# https://github.com/miykael/nipype_env
88

9-
FROM jupyter/base-notebook
9+
FROM miykael/nipype_level1
1010
MAINTAINER Michael Notter <michaelnotter@hotmail.com>
1111

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+
#-------------------------
5215

53-
#-----------------------------------------------------------------------
54-
# Update and install conda dependencies for python2.7 (including nipype)
55-
#-----------------------------------------------------------------------
56-
USER $NB_USER
16+
# <-- Change the level above (under FROM) -->
5717

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 -->
7219

73-
# Make sure that Python2 is loaded before Python3
74-
ENV PATH=/opt/conda/envs/python2/bin:$PATH
7520

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
7928

80-
# Activate ipywidgets extension in the environment that runs the notebook server
81-
RUN jupyter nbextension enable --py widgetsnbextension --sys-prefix
8229

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+
#------------------------------------------------
8733
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
9237

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
9839
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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is the Nipype Tutorial in Notebooks. There are multiple ways of how you can
44

55
1. [Nipype Tutorial Homepage](https://miykael.github.io/nipype_tutorial/): You can find all notebooks used in this tutorial on this homepage.
66
2. [Nipype Course](https://github.com/miykael/nipype_course): Run the notebooks of this tutorial in an interactive docker image and on real example data. The nipype course is the best interactive way to learn Nipype
7-
3. [Your own Nipype environment](https://github.com/miykael/nipype_env): The Dockerfiles for the nipype course are based on the [level3](https://github.com/miykael/nipype_env/blob/master/level3/Dockerfile) version of the [Nipype Environment](https://github.com/miykael/nipype_env). If you want to use docker for your own analysis, that is not based on some example dataset, you can adapt the [Dockerfile from the course](https://github.com/miykael/nipype_course/blob/master/Dockerfile) to the level that you need, and than run it on your own data.
7+
3. [Your own Nipype environment](https://github.com/miykael/nipype_env): The Dockerfiles for the nipype course are based on the [level3](https://github.com/miykael/nipype_env/blob/master/level3/Dockerfile) version of the [Nipype Environment](https://github.com/miykael/nipype_env). If you want to use docker for your own analysis, that is not based on some example dataset, you can adapt the [Dockerfile from this tutorial](https://github.com/miykael/nipype_tutorial/blob/master/Dockerfile) to the level that you need, and than run it on your own system.
88

99

1010
# Feedback, Help & Support

0 commit comments

Comments
 (0)