Skip to content

Commit

Permalink
Merge pull request #55 from BIDS-Apps/neurodocker_support
Browse files Browse the repository at this point in the history
initial draft of neurodocker support
  • Loading branch information
PeerHerholz authored Jun 5, 2020
2 parents 3a65466 + 2225eeb commit d51c7e4
Show file tree
Hide file tree
Showing 4 changed files with 657 additions and 65 deletions.
330 changes: 266 additions & 64 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,73 +1,275 @@
# Generated by Neurodocker version 0.4.2-3-gf7055a1
# Timestamp: 2020-06-04 13:51:08 UTC
#
# Thank you for using Neurodocker. If you discover any issues
# or ways to improve this software, please submit an issue or
# pull request on our GitHub repository:
#
# https://github.com/kaczmarj/neurodocker

FROM ubuntu:xenial

RUN apt-get update \
&& apt-get install -y wget
RUN wget -qO- 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/subjects/fsaverage_sym' \
--exclude='freesurfer/subjects/fsaverage3' \
--exclude='freesurfer/subjects/fsaverage4' \
--exclude='freesurfer/subjects/fsaverage5' \
--exclude='freesurfer/subjects/fsaverage6' \
--exclude='freesurfer/subjects/cvs_avg35' \
--exclude='freesurfer/subjects/cvs_avg35_inMNI152' \
--exclude='freesurfer/subjects/bert' \
--exclude='freesurfer/subjects/V1_average' \
--exclude='freesurfer/average/mult-comp-cor' \
--exclude='freesurfer/lib/cuda' \
--exclude='freesurfer/lib/qt'

RUN apt-get install -y python3
RUN apt-get install -y python3-pip
RUN apt-get install -y python3-pandas
RUN pip3 install nibabel pandas==0.21.0
RUN apt-get install -y python2.7
RUN apt-get install -y python-pip

RUN apt-get install -y tcsh
RUN apt-get install -y bc
RUN apt-get install -y tar libgomp1 perl-modules

RUN apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get install -y nodejs
RUN npm install -g [email protected]

# Configure environment
ENV FSLDIR=/usr/share/fsl/5.0
ENV FSLOUTPUTTYPE=NIFTI_GZ
ENV PATH=/usr/lib/fsl/5.0:$PATH
ENV FSLMULTIFILEQUIT=TRUE
ENV POSSUMDIR=/usr/share/fsl/5.0
ENV LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH
ENV FSLTCLSH=/usr/bin/tclsh
ENV FSLWISH=/usr/bin/wish
ENV FSLOUTPUTTYPE=NIFTI_GZ

ENV OS Linux
ENV FS_OVERRIDE 0
ENV FIX_VERTEX_AREA=
ENV SUBJECTS_DIR /opt/freesurfer/subjects
ENV FSF_OUTPUT_FORMAT nii.gz
ENV MNI_DIR /opt/freesurfer/mni
ENV LOCAL_DIR /opt/freesurfer/local
ENV FREESURFER_HOME /opt/freesurfer
ENV FSFAST_HOME /opt/freesurfer/fsfast
ENV MINC_BIN_DIR /opt/freesurfer/mni/bin
ENV MINC_LIB_DIR /opt/freesurfer/mni/lib
ENV MNI_DATAPATH /opt/freesurfer/mni/data
ENV FMRI_ANALYSIS_DIR /opt/freesurfer/fsfast
ENV PERL5LIB /opt/freesurfer/mni/lib/perl5/5.8.5
ENV MNI_PERL5LIB /opt/freesurfer/mni/lib/perl5/5.8.5
ENV PATH /opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV PYTHONPATH=""
ARG DEBIAN_FRONTEND="noninteractive"

ENV LANG="en_US.UTF-8" \
LC_ALL="en_US.UTF-8" \
ND_ENTRYPOINT="/neurodocker/startup.sh"
RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \
&& apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
apt-utils \
bzip2 \
ca-certificates \
curl \
locales \
unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale LANG="en_US.UTF-8" \
&& chmod 777 /opt && chmod a+s /opt \
&& mkdir -p /neurodocker \
&& if [ ! -f "$ND_ENTRYPOINT" ]; then \
echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" \
&& echo 'set -e' >> "$ND_ENTRYPOINT" \
&& echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; \
fi \
&& chmod -R 777 /neurodocker && chmod a+s /neurodocker

ENTRYPOINT ["/neurodocker/startup.sh"]

RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
tcsh \
bc \
tar \
libgomp1 \
perl-modules \
wget \
curl \
python3 \
python3-pip \
python3-pandas \
python-pip \
libsm-dev \
libx11-dev \
libxt-dev \
libxext-dev \
libglu1-mesa \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ENV FREESURFER_HOME="/opt/freesurfer" \
PATH="/opt/freesurfer/bin:$PATH"
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
bc \
libgomp1 \
libxmu6 \
libxt6 \
perl \
tcsh \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& echo "Downloading FreeSurfer ..." \
&& mkdir -p /opt/freesurfer \
&& curl -fsSL --retry 5 ftp://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/6.0.1/freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1.tar.gz \
| tar -xz -C /opt/freesurfer --strip-components 1 \
--exclude='freesurfer/average/mult-comp-cor' \
--exclude='freesurfer/lib/cuda' \
--exclude='freesurfer/lib/qt' \
--exclude='freesurfer/subjects/V1_average' \
--exclude='freesurfer/subjects/bert' \
--exclude='freesurfer/subjects/cvs_avg35' \
--exclude='freesurfer/subjects/cvs_avg35_inMNI152' \
--exclude='freesurfer/subjects/fsaverage3' \
--exclude='freesurfer/subjects/fsaverage4' \
--exclude='freesurfer/subjects/fsaverage5' \
--exclude='freesurfer/subjects/fsaverage6' \
--exclude='freesurfer/subjects/fsaverage_sym' \
--exclude='freesurfer/trctrain' \
&& sed -i '$isource "/opt/freesurfer/SetUpFreeSurfer.sh"' "$ND_ENTRYPOINT"

RUN bash -c 'pip3 install nibabel pandas==0.21.0'

RUN bash -c 'curl -sL https://deb.nodesource.com/setup_6.x | bash -'

RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN bash -c 'npm install -g [email protected]'

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:" \
FSLTCLSH="/usr/bin/tclsh" \
FSLWISH="/usr/bin/wish"

RUN bash -c 'PATH=/usr/lib/fsl/5.0:$PATH'

ENV OS="Linux" \
FS_OVERRIDE="0" \
FIX_VERTEX_AREA="" \
SUBJECTS_DIR="/opt/freesurfer/subjects" \
FSF_OUTPUT_FORMAT="nii.gz" \
MNI_DIR="/opt/freesurfer/mni" \
LOCAL_DIR="/opt/freesurfer/local" \
FREESURFER_HOME="/opt/freesurfer" \
FSFAST_HOME="/opt/freesurfer/fsfast" \
MINC_BIN_DIR="/opt/freesurfer/mni/bin" \
MINC_LIB_DIR="/opt/freesurfer/mni/lib" \
MNI_DATAPATH="/opt/freesurfer/mni/data" \
FMRI_ANALYSIS_DIR="/opt/freesurfer/fsfast" \
PERL5LIB="/opt/freesurfer/mni/share/perl5" \
MNI_PERL5LIB="/opt/freesurfer/mni/share/perl5/" \
PATH="/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
PYTHONPATH=""

RUN mkdir root/matlab && touch root/matlab/startup.m

RUN mkdir /scratch

RUN mkdir /local-scratch

COPY run.py /run.py
COPY ["run.py", "/run.py"]

RUN chmod +x /run.py

COPY version /version
COPY ["version", "/version"]

ENTRYPOINT ["/neurodocker/startup.sh", "/run.py"]

ENTRYPOINT ["/run.py"]
RUN echo '{ \
\n "pkg_manager": "apt", \
\n "instructions": [ \
\n [ \
\n "base", \
\n "ubuntu:xenial" \
\n ], \
\n [ \
\n "install", \
\n [ \
\n "tcsh", \
\n "bc", \
\n "tar", \
\n "libgomp1", \
\n "perl-modules", \
\n "wget", \
\n "curl", \
\n "python3", \
\n "python3-pip", \
\n "python3-pandas", \
\n "python2.7", \
\n "python-pip", \
\n "libsm-dev", \
\n "libx11-dev", \
\n "libxt-dev", \
\n "libxext-dev", \
\n "libglu1-mesa" \
\n ] \
\n ], \
\n [ \
\n "freesurfer", \
\n { \
\n "version": "6.0.1", \
\n "install_path": "/opt/freesurfer" \
\n } \
\n ], \
\n [ \
\n "run_bash", \
\n "pip3 install nibabel pandas==0.21.0" \
\n ], \
\n [ \
\n "run_bash", \
\n "curl -sL https://deb.nodesource.com/setup_6.x | bash -" \
\n ], \
\n [ \
\n "install", \
\n [ \
\n "nodejs" \
\n ] \
\n ], \
\n [ \
\n "run_bash", \
\n "npm install -g [email protected]" \
\n ], \
\n [ \
\n "env", \
\n { \
\n "FSLDIR": "/usr/share/fsl/5.0", \
\n "FSLOUTPUTTYPE": "NIFTI_GZ", \
\n "FSLMULTIFILEQUIT": "TRUE", \
\n "POSSUMDIR": "/usr/share/fsl/5.0", \
\n "LD_LIBRARY_PATH": "/usr/lib/fsl/5.0:", \
\n "FSLTCLSH": "/usr/bin/tclsh", \
\n "FSLWISH": "/usr/bin/wish" \
\n } \
\n ], \
\n [ \
\n "run_bash", \
\n "PATH=/usr/lib/fsl/5.0:$PATH" \
\n ], \
\n [ \
\n "env", \
\n { \
\n "OS": "Linux", \
\n "FS_OVERRIDE": "0", \
\n "FIX_VERTEX_AREA": "", \
\n "SUBJECTS_DIR": "/opt/freesurfer/subjects", \
\n "FSF_OUTPUT_FORMAT": "nii.gz", \
\n "MNI_DIR": "/opt/freesurfer/mni", \
\n "LOCAL_DIR": "/opt/freesurfer/local", \
\n "FREESURFER_HOME": "/opt/freesurfer", \
\n "FSFAST_HOME": "/opt/freesurfer/fsfast", \
\n "MINC_BIN_DIR": "/opt/freesurfer/mni/bin", \
\n "MINC_LIB_DIR": "/opt/freesurfer/mni/lib", \
\n "MNI_DATAPATH": "/opt/freesurfer/mni/data", \
\n "FMRI_ANALYSIS_DIR": "/opt/freesurfer/fsfast", \
\n "PERL5LIB": "/opt/freesurfer/mni/share/perl5", \
\n "MNI_PERL5LIB": "/opt/freesurfer/mni/share/perl5/", \
\n "PATH": "/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", \
\n "PYTHONPATH": "" \
\n } \
\n ], \
\n [ \
\n "run", \
\n "mkdir root/matlab && touch root/matlab/startup.m" \
\n ], \
\n [ \
\n "run", \
\n "mkdir /scratch" \
\n ], \
\n [ \
\n "run", \
\n "mkdir /local-scratch" \
\n ], \
\n [ \
\n "copy", \
\n [ \
\n "run.py", \
\n "/run.py" \
\n ] \
\n ], \
\n [ \
\n "run", \
\n "chmod +x /run.py" \
\n ], \
\n [ \
\n "copy", \
\n [ \
\n "version", \
\n "/version" \
\n ] \
\n ], \
\n [ \
\n "entrypoint", \
\n "/neurodocker/startup.sh /run.py" \
\n ] \
\n ] \
\n}' > /neurodocker/neurodocker_specs.json
Loading

0 comments on commit d51c7e4

Please sign in to comment.