|
| 1 | +# Copyright (c) 2016, The developers of the Stanford CRN |
| 2 | +# All rights reserved. |
| 3 | +# |
| 4 | +# Redistribution and use in source and binary forms, with or without |
| 5 | +# modification, are permitted provided that the following conditions are met: |
| 6 | +# |
| 7 | +# * Redistributions of source code must retain the above copyright notice, this |
| 8 | +# list of conditions and the following disclaimer. |
| 9 | +# |
| 10 | +# * Redistributions in binary form must reproduce the above copyright notice, |
| 11 | +# this list of conditions and the following disclaimer in the documentation |
| 12 | +# and/or other materials provided with the distribution. |
| 13 | +# |
| 14 | +# * Neither the name of crn_base nor the names of its |
| 15 | +# contributors may be used to endorse or promote products derived from |
| 16 | +# this software without specific prior written permission. |
| 17 | +# |
| 18 | +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 19 | +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 20 | +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 21 | +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| 22 | +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 23 | +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 24 | +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 25 | +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 26 | +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 | +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | + |
| 29 | +FROM ubuntu:vivid |
| 30 | +MAINTAINER Stanford Center for Reproducible Neuroscience < [email protected]> |
| 31 | + |
| 32 | +# Preparations |
| 33 | +RUN ln -snf /bin/bash /bin/sh |
| 34 | +ARG DEBIAN_FRONTEND=noninteractive |
| 35 | + |
| 36 | +# Update packages and install the minimal set of tools |
| 37 | +RUN apt-get update && \ |
| 38 | + apt-get install -y curl \ |
| 39 | + git \ |
| 40 | + xvfb \ |
| 41 | + bzip2 \ |
| 42 | + unzip \ |
| 43 | + apt-utils \ |
| 44 | + gfortran \ |
| 45 | + fusefat \ |
| 46 | + liblapack-dev \ |
| 47 | + libblas-dev \ |
| 48 | + libatlas-dev \ |
| 49 | + libatlas-base-dev \ |
| 50 | + libblas3 \ |
| 51 | + libblas-common \ |
| 52 | + libopenblas-dev \ |
| 53 | + libxml2-dev \ |
| 54 | + libxslt1-dev \ |
| 55 | + libfreetype6-dev \ |
| 56 | + libpng12-dev \ |
| 57 | + libqhull-dev \ |
| 58 | + libxft-dev \ |
| 59 | + libjpeg-dev \ |
| 60 | + libyaml-dev |
| 61 | + |
| 62 | + |
| 63 | +# Install ANTs |
| 64 | +RUN mkdir -p /opt/ants && \ |
| 65 | + curl -sSL "https://2a353b13e8d2d9ac21ce543b7064482f771ce658.googledrive.com/host/0BxI12kyv2olZVFhUcGVpYWF3R3c/ANTs-Linux_Ubuntu14.04.tar.bz2" \ |
| 66 | + | tar -xjC /opt/ants --strip-components 1 |
| 67 | +ENV ANTSPATH /opt/ants |
| 68 | +ENV PATH $ANTSPATH:$PATH |
| 69 | + |
| 70 | +# Enable neurodebian |
| 71 | +RUN curl -sSL http://neuro.debian.net/lists/vivid.de-m.full | tee /etc/apt/sources.list.d/neurodebian.sources.list && \ |
| 72 | + curl -sSL http://neuro.debian.net/lists/vivid.us-tn.full >> /etc/apt/sources.list.d/neurodebian.sources.list && \ |
| 73 | + apt-key adv --recv-keys --keyserver hkp://pgp.mit.edu:80 0xA5D32F012649A5A9 && \ |
| 74 | + apt-get update && \ |
| 75 | + apt-get install -y fsl-core afni |
| 76 | + |
| 77 | +RUN echo '#!/bin/bash' > /etc/profile.d/nipype_deps.sh && \ |
| 78 | + echo 'export ANTSPATH=/opt/ants' >> /etc/profile.d/nipype_deps.sh && \ |
| 79 | + echo 'export PATH=$ANTSPATH:$PATH' >> /etc/profile.d/nipype_deps.sh && \ |
| 80 | + echo 'source /etc/fsl/fsl.sh' >> /etc/profile.d/nipype_deps.sh && \ |
| 81 | + echo 'source /etc/afni/afni.sh' >> /etc/profile.d/nipype_deps.sh |
| 82 | + |
| 83 | +# Clear apt cache to reduce image size |
| 84 | +RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
| 85 | + |
| 86 | +# Install Matlab: from the good old install_spm_mcr.sh of @chrisfilo |
| 87 | +WORKDIR /root |
| 88 | + |
| 89 | +RUN echo "destinationFolder=/root/mcr" > mcr_options.txt && \ |
| 90 | + echo "agreeToLicense=yes" >> mcr_options.txt && \ |
| 91 | + echo "outputFile=/tmp/matlabinstall_log" >> mcr_options.txt && \ |
| 92 | + echo "mode=silent" >> mcr_options.txt && \ |
| 93 | + mkdir -p matlab_installer && \ |
| 94 | + curl -sSL http://www.mathworks.com/supportfiles/downloads/R2015a/deployment_files/R2015a/installers/glnxa64/MCR_R2015a_glnxa64_installer.zip \ |
| 95 | + -o matlab_installer/installer.zip && \ |
| 96 | + unzip matlab_installer/installer.zip -d matlab_installer/ && \ |
| 97 | + matlab_installer/install -inputFile mcr_options.txt && \ |
| 98 | + rm -rf matlab_installer mcr_options.txt && \ |
| 99 | + echo 'export LD_LIBRARY_PATH=/root/mcr/v85/runtime/glnxa64:/root/mcr/v85/bin/glnxa64:/root/mcr/v85/sys/os/glnxa64:$LD_LIBRARY_PATH' >> /etc/profile.d/nipype_deps.sh && \ |
| 100 | + echo 'export SPMMCRCMD="/root/spm12/run_spm12.sh /root/mcr/v85/ script"' >> /etc/profile.d/nipype_deps.sh && \ |
| 101 | + echo 'export FORCE_SPMMCR=1' >> /etc/profile.d/nipype_deps.sh |
| 102 | + |
| 103 | +ENV LD_LIBRARY_PATH "/root/mcr/v85/runtime/glnxa64:/root/mcr/v85/bin/glnxa64:/root/mcr/v85/sys/os/glnxa64:$LD_LIBRARY_PATH" |
| 104 | +ENV SPMMCRCMD "/root/spm12/run_spm12.sh /root/mcr/v85/ script" |
| 105 | +ENV FORCE_SPMMCR 1 |
| 106 | + |
| 107 | +# Install SPM |
| 108 | +RUN curl -sSL http://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/dev/spm12_r6472_Linux_R2015a.zip -o spm12.zip && \ |
| 109 | + unzip spm12.zip && \ |
| 110 | + rm -rf spm12.zip |
| 111 | + |
| 112 | +RUN echo "source /etc/profile.d/nipype_deps.sh" >> /etc/bash.bashrc |
| 113 | + |
| 114 | +CMD ["/bin/bash"] |
| 115 | + |
0 commit comments