generated from fastai/nbdev_template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
singularity.def
228 lines (213 loc) · 5.96 KB
/
singularity.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# Generated by: Neurodocker version 0.7.0+12.g913b321
# Latest release: Neurodocker version 0.7.0
# Timestamp: 2020/07/20 21:49:03 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/ReproNim/neurodocker
Bootstrap: docker
From: debian:stretch
%post
su - root
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/*
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 'export USER="${USER:=`whoami`}"' >> "$ND_ENTRYPOINT"
echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT";
fi
chmod -R 777 /neurodocker && chmod a+s /neurodocker
echo "Downloading MRtrix3 ..."
mkdir -p /opt/mrtrix3-3.0.0
curl -fsSL --retry 5 https://github.com/kaczmarj/MRtrix3-builds/releases/download/3.0.0/mrtrix3-3.0.0-Linux-centos6-x86_64.tar.gz \
| tar -xz -C /opt/mrtrix3-3.0.0 --strip-components 1
echo "Downloading ANTs ..."
mkdir -p /opt/ants-2.3.1
curl -fsSL --retry 5 https://dl.dropbox.com/s/1xfhydsf4t4qoxg/ants-Linux-centos6_x86_64-v2.3.1.tar.gz \
| tar -xz -C /opt/ants-2.3.1 --strip-components 1
apt-get update -qq
apt-get install -y -q --no-install-recommends \
bc \
dc \
file \
libfontconfig1 \
libfreetype6 \
libgl1-mesa-dev \
libgl1-mesa-dri \
libglu1-mesa-dev \
libgomp1 \
libice6 \
libxcursor1 \
libxft2 \
libxinerama1 \
libxrandr2 \
libxrender1 \
libxt6 \
sudo \
wget
apt-get clean
rm -rf /var/lib/apt/lists/*
echo "Downloading FSL ..."
mkdir -p /opt/fsl-6.0.3
curl -fsSL --retry 5 https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.3-centos6_64.tar.gz \
| tar -xz -C /opt/fsl-6.0.3 --strip-components 1
sed -i '$iecho Some packages in this Docker container are non-free' $ND_ENTRYPOINT
sed -i '$iecho If you are considering commercial use of this container, please consult the relevant license:' $ND_ENTRYPOINT
sed -i '$iecho https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Licence' $ND_ENTRYPOINT
sed -i '$isource $FSLDIR/etc/fslconf/fsl.sh' $ND_ENTRYPOINT
echo "Installing FSL conda environment ..."
bash /opt/fsl-6.0.3/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.3
apt-get update -qq
apt-get install -y -q --no-install-recommends \
dirmngr \
gnupg2
apt-get clean
rm -rf /var/lib/apt/lists/*
curl -fsSL --retry 5 http://neuro.debian.net/lists/stretch.us-nh.full \
> /etc/apt/sources.list.d/neurodebian.sources.list
curl -sSL https://dl.dropbox.com/s/zxs209o955q6vkg/neurodebian.gpg | apt-key add -
(apt-key adv --refresh-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9 || true)
apt-get -qq update
export PATH="/opt/miniconda-latest/bin:$PATH"
echo "Downloading Miniconda installer ..."
conda_installer="/tmp/miniconda.sh"
curl -fsSL --retry 5 -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash "$conda_installer" -b -p /opt/miniconda-latest
rm -f "$conda_installer"
conda update -yq -nbase conda
conda config --system --prepend channels conda-forge
conda config --system --set auto_update_conda false
conda config --system --set show_channel_urls true
sync && conda clean -y --all && sync
conda install -y -q --name base \
"python=3.7.3" \
"pip=20.0.2" \
"dipy" \
"nipype" \
"nibabel"
sync && conda clean -y --all && sync
bash -c "source activate base
pip install --no-cache-dir \
"pybids" \
"fastcore" \
"nilearn" \
"pipetography==0.3.12""
rm -rf ~/.cache/pip/*
sync
apt-get update -qq
apt-get install -y -q --no-install-recommends \
git \
ssh \
tar \
gzip \
ca-certificates \
fsl-first-data
apt-get clean
rm -rf /var/lib/apt/lists/*
ldconfig
echo '{
\n "pkg_manager": "apt",
\n "instructions": [
\n [
\n "base",
\n "debian:stretch"
\n ],
\n [
\n "user",
\n "root"
\n ],
\n [
\n "_header",
\n {
\n "version": "generic",
\n "method": "custom"
\n }
\n ],
\n [
\n "mrtrix3",
\n {
\n "version": "3.0_RC3"
\n }
\n ],
\n [
\n "ants",
\n {
\n "version": "2.3.1"
\n }
\n ],
\n [
\n "fsl",
\n {
\n "version": "6.0.1"
\n }
\n ],
\n [
\n "miniconda",
\n {
\n "use_env": "base",
\n "conda_install": [
\n "python=3.7.3",
\n "pip=20.0.2",
\n "dipy",
\n "nipype",
\n "nibabel"
\n ],
\n "pip_install": [
\n "pybids",
\n "fastcore",
\n "nilearn",
\n "pipetography==0.3.12"
\n ]
\n }
\n ],
\n [
\n "install",
\n [
\n "git",
\n "ssh",
\n "tar",
\n "gzip",
\n "ca-certificates"
\n ]
\n ]
\n ]
\n}' > /neurodocker/neurodocker_specs.json
%environment
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export ND_ENTRYPOINT="/neurodocker/startup.sh"
export PATH="/opt/mrtrix3-3.0.0/bin:$PATH"
export ANTSPATH="/opt/ants-2.3.1"
export PATH="/opt/ants-2.3.1:$PATH"
export FSLDIR="/opt/fsl-6.0.3"
export PATH="/opt/fsl-6.0.3/bin:$PATH"
export FSLOUTPUTTYPE="NIFTI_GZ"
export FSLMULTIFILEQUIT="TRUE"
export FSLTCLSH="/opt/fsl-6.0.3/bin/fsltclsh"
export FSLWISH="/opt/fsl-6.0.3/bin/fslwish"
export FSLLOCKDIR=""
export FSLMACHINELIST=""
export FSLREMOTECALL=""
export FSLGECUDAQ="cuda.q"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu:/opt/miniconda-latest/lib/"
export CONDA_DIR="/opt/miniconda-latest"
export PATH="/opt/miniconda-latest/bin:$PATH"
%runscript
/neurodocker/startup.sh "$@"