|
| 1 | +# This Dockerfile is based on the dockerfile 'fmriprep' from the Poldrack |
| 2 | +# Lab (https://github.com/poldracklab/fmriprep). |
| 3 | +# |
| 4 | +# This means that the same copyrights apply to this Dockerfile, as they do for |
| 5 | +# the above mentioned dockerfile. For more information see: |
| 6 | +# https://github.com/miykael/nipype_tutorial |
| 7 | +FROM andrewosh/binder-base |
| 8 | + |
| 9 | +MAINTAINER Michael Notter < [email protected]> |
| 10 | + |
| 11 | +# Switch to root user for installation |
| 12 | +USER root |
| 13 | + |
| 14 | +#--------------------------------------------- |
| 15 | +# Update OS dependencies and setup neurodebian |
| 16 | +#--------------------------------------------- |
| 17 | +USER root |
| 18 | +RUN ln -snf /bin/bash /bin/sh |
| 19 | +ARG DEBIAN_FRONTEND=noninteractive |
| 20 | +RUN apt-get update && \ |
| 21 | + apt-get install -yq --no-install-recommends bzip2 ca-certificates curl git tree unzip wget xvfb zip |
| 22 | +ENV NEURODEBIAN_URL http://neuro.debian.net/lists/jessie.de-md.full |
| 23 | +RUN curl -sSL $NEURODEBIAN_URL | tee /etc/apt/sources.list.d/neurodebian.sources.list && \ |
| 24 | + apt-key adv --recv-keys --keyserver hkp://pgp.mit.edu:80 0xA5D32F012649A5A9 && \ |
| 25 | + apt-get update -qq |
| 26 | + |
| 27 | +#--------------------- |
| 28 | +# Install FSL and AFNI |
| 29 | +#--------------------- |
| 30 | +USER root |
| 31 | +RUN apt-get update && \ |
| 32 | + apt-get install -y -qq --no-install-recommends fsl-core fsl-atlases afni |
| 33 | +ENV FSLDIR=/usr/share/fsl/5.0 \ |
| 34 | + FSLOUTPUTTYPE=NIFTI_GZ \ |
| 35 | + FSLMULTIFILEQUIT=TRUE \ |
| 36 | + POSSUMDIR=/usr/share/fsl/5.0 \ |
| 37 | + LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH \ |
| 38 | + FSLTCLSH=/usr/bin/tclsh \ |
| 39 | + FSLWISH=/usr/bin/wish \ |
| 40 | + AFNI_MODELPATH=/usr/lib/afni/models \ |
| 41 | + AFNI_IMSAVE_WARNINGS=NO \ |
| 42 | + AFNI_TTATLAS_DATASET=/usr/share/afni/atlases \ |
| 43 | + AFNI_PLUGINPATH=/usr/lib/afni/plugins \ |
| 44 | + PATH=/usr/lib/fsl/5.0:/usr/lib/afni/bin:$PATH |
| 45 | + |
| 46 | +#----------------------------------------------------- |
| 47 | +# Update conda and pip dependencies (including Nipype) |
| 48 | +#----------------------------------------------------- |
| 49 | +RUN conda update conda --yes --quiet |
| 50 | +RUN conda config --add channels conda-forge |
| 51 | +RUN conda install --yes --quiet ipython \ |
| 52 | + pip \ |
| 53 | + jupyter \ |
| 54 | + notebook \ |
| 55 | + nb_conda \ |
| 56 | + nb_conda_kernels \ |
| 57 | + matplotlib \ |
| 58 | + graphviz \ |
| 59 | + pandas \ |
| 60 | + seaborn \ |
| 61 | + nipype |
| 62 | +RUN python -c "from matplotlib import font_manager" |
| 63 | + |
| 64 | +# Clean up Python3 environment and delete not needed packages |
| 65 | +RUN conda remove --name python3 --all --yes --quiet && \ |
| 66 | + conda remove qt pyqt scikit-image scikit-learn sympy --yes --quiet && \ |
| 67 | + conda clean -tipsy |
| 68 | + |
| 69 | +#--------------------------------------------- |
| 70 | +# Install graphviz and update pip dependencies |
| 71 | +#--------------------------------------------- |
| 72 | +USER root |
| 73 | +RUN apt-get install -yq --no-install-recommends graphviz |
| 74 | +USER $NB_USER |
| 75 | +RUN pip install --upgrade --quiet pip && \ |
| 76 | + pip install --upgrade --quiet nipy \ |
| 77 | + rdflib \ |
| 78 | + --ignore-installed && \ |
| 79 | + rm -rf ~/.cache/pip |
| 80 | + |
| 81 | +#----------------------------------------------------- |
| 82 | +# Clear apt cache and delete unnecessary folders |
| 83 | +#----------------------------------------------------- |
| 84 | +RUN apt-get clean remove -y && \ |
| 85 | + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /boot /media /mnt /opt /srv |
| 86 | + |
| 87 | +ENV SHELL /bin/bash |
0 commit comments