anchor.diff:                      build-essential \
                       autoconf \
                       libtool \
  -                    pkg-config && \
  -    curl -sSL http://neuro.debian.net/lists/xenial.us-ca.full >> /etc/apt/sources.list.d/neurodebian.sources.list && \
  -    apt-key add /root/.neurodebian.gpg && \
  -    (apt-key adv --refresh-keys --keyserver hkp://ha.pool.sks-keyservers.net 0xA5D32F012649A5A9 || true) && \
  -    apt-get update
  +                    pkg-config \
  +                    git && \
  +    curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
  +    apt-get install -y --no-install-recommends \
  +                    nodejs && \
  +    apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  +
  +# Install latest pandoc
  +RUN curl -o pandoc-2.2.2.1-1-amd64.deb -sSL "https://github.com/jgm/pandoc/releases/download/2.2.2.1/pandoc-2.2.2.1-1-amd64.deb" && \
  +    dpkg -i pandoc-2.2.2.1-1-amd64.deb && \
  +    rm pandoc-2.2.2.1-1-amd64.deb
   
   # Installing freesurfer
   RUN curl -sSL https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz | tar zxv --no-same-owner -C /opt \
  -    --exclude='freesurfer/trctrain' \
  +    --exclude='freesurfer/diffusion' \
  +    --exclude='freesurfer/docs' \
  +    --exclude='freesurfer/fsfast' \
  +    --exclude='freesurfer/lib/cuda' \
  +    --exclude='freesurfer/lib/qt' \
  +    --exclude='freesurfer/matlab' \
  +    --exclude='freesurfer/mni/share/man' \
       --exclude='freesurfer/subjects/fsaverage_sym' \
       --exclude='freesurfer/subjects/fsaverage3' \
       --exclude='freesurfer/subjects/fsaverage4' \
       --exclude='freesurfer/subjects/cvs_avg35' \
       --exclude='freesurfer/subjects/cvs_avg35_inMNI152' \
       --exclude='freesurfer/subjects/bert' \
  +    --exclude='freesurfer/subjects/lh.EC_average' \
  +    --exclude='freesurfer/subjects/rh.EC_average' \
  +    --exclude='freesurfer/subjects/sample-*.mgz' \
       --exclude='freesurfer/subjects/V1_average' \
  -    --exclude='freesurfer/average/mult-comp-cor' \
  -    --exclude='freesurfer/lib/cuda' \
  -    --exclude='freesurfer/lib/qt'
  -
  -ENV FSL_DIR=/usr/share/fsl/5.0 \
  -    OS=Linux \
  +    --exclude='freesurfer/trctrain'
  +
  +ENV FSL_DIR="/usr/share/fsl/5.0" \
  +    OS="Linux" \
       FS_OVERRIDE=0 \
  -    FIX_VERTEX_AREA= \
  -    FSF_OUTPUT_FORMAT=nii.gz \
  -    FREESURFER_HOME=/opt/freesurfer
  -ENV SUBJECTS_DIR=$FREESURFER_HOME/subjects \
  -    FUNCTIONALS_DIR=$FREESURFER_HOME/sessions \
  -    MNI_DIR=$FREESURFER_HOME/mni \
  -    LOCAL_DIR=$FREESURFER_HOME/local \
  -    FSFAST_HOME=$FREESURFER_HOME/fsfast \
  -    MINC_BIN_DIR=$FREESURFER_HOME/mni/bin \
  -    MINC_LIB_DIR=$FREESURFER_HOME/mni/lib \
  -    MNI_DATAPATH=$FREESURFER_HOME/mni/data \
  -    FMRI_ANALYSIS_DIR=$FREESURFER_HOME/fsfast
  -ENV PERL5LIB=$MINC_LIB_DIR/perl5/5.8.5 \
  -    MNI_PERL5LIB=$MINC_LIB_DIR/perl5/5.8.5 \
  -    PATH=$FREESURFER_HOME/bin:$FSFAST_HOME/bin:$FREESURFER_HOME/tktools:$MINC_BIN_DIR:$PATH
  +    FIX_VERTEX_AREA="" \
  +    FSF_OUTPUT_FORMAT="nii.gz" \
  +    FREESURFER_HOME="/opt/freesurfer"
  +ENV SUBJECTS_DIR="$FREESURFER_HOME/subjects" \
  +    FUNCTIONALS_DIR="$FREESURFER_HOME/sessions" \
  +    MNI_DIR="$FREESURFER_HOME/mni" \
  +    LOCAL_DIR="$FREESURFER_HOME/local" \
  +    MINC_BIN_DIR="$FREESURFER_HOME/mni/bin" \
  +    MINC_LIB_DIR="$FREESURFER_HOME/mni/lib" \
  +    MNI_DATAPATH="$FREESURFER_HOME/mni/data"
  +ENV PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \
  +    MNI_PERL5LIB="$MINC_LIB_DIR/perl5/5.8.5" \
  +    PATH="$FREESURFER_HOME/bin:$FSFAST_HOME/bin:$FREESURFER_HOME/tktools:$MINC_BIN_DIR:$PATH"
   
   # Installing Neurodebian packages (FSL, AFNI, git)
  +RUN curl -sSL "http://neuro.debian.net/lists/$( lsb_release -c | cut -f2 ).us-ca.full" >> /etc/apt/sources.list.d/neurodebian.sources.list && \
  +    apt-key add /root/.neurodebian.gpg && \
  +    (apt-key adv --refresh-keys --keyserver hkp://ha.pool.sks-keyservers.net 0xA5D32F012649A5A9 || true)
  +
   RUN apt-get update && \
       apt-get install -y --no-install-recommends \
                       fsl-core=5.0.9-5~nd16.04+1 \
  -                    fsl-mni152-templates=5.0.7-2 \
                       afni=16.2.07~dfsg.1-5~nd16.04+1 \
  -                    convert3d
  -
  -ENV FSLDIR=/usr/share/fsl/5.0 \
  -    FSLOUTPUTTYPE=NIFTI_GZ \
  -    FSLMULTIFILEQUIT=TRUE \
  -    POSSUMDIR=/usr/share/fsl/5.0 \
  -    LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH \
  -    FSLTCLSH=/usr/bin/tclsh \
  -    FSLWISH=/usr/bin/wish \
  -    AFNI_MODELPATH=/usr/lib/afni/models \
  -    AFNI_IMSAVE_WARNINGS=NO \
  -    AFNI_TTATLAS_DATASET=/usr/share/afni/atlases \
  -    AFNI_PLUGINPATH=/usr/lib/afni/plugins
  -ENV PATH=/usr/lib/fsl/5.0:/usr/lib/afni/bin:$PATH
  +                    convert3d \
  +                    git-annex-standalone && \
  +    apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  +
  +ENV FSLDIR="/usr/share/fsl/5.0" \
  +    FSLOUTPUTTYPE="NIFTI_GZ" \
  +    FSLMULTIFILEQUIT="TRUE" \
  +    POSSUMDIR="/usr/share/fsl/5.0" \
  +    LD_LIBRARY_PATH="/usr/lib/fsl/5.0:$LD_LIBRARY_PATH" \
  +    FSLTCLSH="/usr/bin/tclsh" \
  +    FSLWISH="/usr/bin/wish" \
  +    AFNI_MODELPATH="/usr/lib/afni/models" \
  +    AFNI_IMSAVE_WARNINGS="NO" \
  +    AFNI_TTATLAS_DATASET="/usr/share/afni/atlases" \
  +    AFNI_PLUGINPATH="/usr/lib/afni/plugins"
  +ENV PATH="/usr/lib/fsl/5.0:/usr/lib/afni/bin:$PATH"
   
   # Installing ANTs 2.2.0 (NeuroDocker build)
   ENV ANTSPATH=/usr/lib/ants
  
positive.code: ARG VCS_REF
  ARG VERSION
  LABEL org.label-schema.build-date=$BUILD_DATE \
        org.label-schema.name="FMRIPREP" \
        org.label-schema.description="FMRIPREP - robust fMRI preprocessing tool" \
        org.label-schema.url="http://fmriprep.org" \
        org.label-schema.vcs-ref=$VCS_REF \
        org.label-schema.vcs-url="https://github.com/poldracklab/fmriprep" \
        org.label-schema.version=$VERSION \
  
negative.code:                      libxslt=1.1.32 \
                       graphviz=2.40.1 \
                       traits=4.6.0 \
                       zlib; sync && \
      chmod -R a+rX /usr/local/miniconda; sync && \
      chmod +x /usr/local/miniconda/bin/*; sync && \
      conda clean --all -y; sync && \
  