Skip to content

Commit 5f26334

Browse files
committed
ENH: update neurodocker to newest version 0.4.0
1 parent d80bf15 commit 5f26334

File tree

2 files changed

+129
-121
lines changed

2 files changed

+129
-121
lines changed

Dockerfile

Lines changed: 125 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,178 +1,171 @@
1-
# Generated by Neurodocker v0.3.2.
2-
#
1+
# Generated by Neurodocker version 0.4.0.dev2
2+
# Timestamp: 2018-05-18 14:48:41 UTC
3+
#
34
# Thank you for using Neurodocker. If you discover any issues
45
# or ways to improve this software, please submit an issue or
56
# pull request on our GitHub repository:
7+
#
68
# https://github.com/kaczmarj/neurodocker
7-
#
8-
# Timestamp: 2018-05-16 09:31:36
99

1010
FROM neurodebian:stretch-non-free
1111

12-
ARG DEBIAN_FRONTEND=noninteractive
12+
ARG DEBIAN_FRONTEND="noninteractive"
1313

14-
#----------------------------------------------------------
15-
# Install common dependencies and create default entrypoint
16-
#----------------------------------------------------------
1714
ENV LANG="en_US.UTF-8" \
18-
LC_ALL="C.UTF-8" \
15+
LC_ALL="en_US.UTF-8" \
1916
ND_ENTRYPOINT="/neurodocker/startup.sh"
20-
RUN apt-get update -qq && apt-get install -yq --no-install-recommends \
21-
apt-utils bzip2 ca-certificates curl locales unzip \
17+
RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \
18+
&& apt-get update -qq \
19+
&& apt-get install -y -q --no-install-recommends \
20+
apt-utils \
21+
bzip2 \
22+
ca-certificates \
23+
curl \
24+
locales \
25+
unzip \
2226
&& apt-get clean \
2327
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
24-
&& localedef --force --inputfile=en_US --charmap=UTF-8 C.UTF-8 \
28+
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
29+
&& dpkg-reconfigure --frontend=noninteractive locales \
30+
&& update-locale LANG="en_US.UTF-8" \
2531
&& chmod 777 /opt && chmod a+s /opt \
2632
&& mkdir -p /neurodocker \
2733
&& if [ ! -f "$ND_ENTRYPOINT" ]; then \
28-
echo '#!/usr/bin/env bash' >> $ND_ENTRYPOINT \
29-
&& echo 'set +x' >> $ND_ENTRYPOINT \
30-
&& echo 'if [ -z "$*" ]; then /usr/bin/env bash; else $*; fi' >> $ND_ENTRYPOINT; \
31-
fi \
34+
echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" \
35+
&& echo 'set -e' >> "$ND_ENTRYPOINT" \
36+
&& echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; \
37+
fi \
3238
&& chmod -R 777 /neurodocker && chmod a+s /neurodocker
39+
3340
ENTRYPOINT ["/neurodocker/startup.sh"]
3441

3542
RUN apt-get update -qq \
36-
&& apt-get install -y -q --no-install-recommends convert3d \
37-
ants \
38-
fsl \
39-
gcc \
40-
g++ \
41-
graphviz \
42-
tree \
43-
git-annex-standalone \
44-
vim \
45-
emacs-nox \
46-
nano \
47-
less \
48-
ncdu \
49-
tig \
50-
git-annex-remote-rclone \
51-
octave \
43+
&& apt-get install -y -q --no-install-recommends \
44+
convert3d \
45+
ants \
46+
fsl \
47+
gcc \
48+
g++ \
49+
graphviz \
50+
tree \
51+
git-annex-standalone \
52+
vim \
53+
emacs-nox \
54+
nano \
55+
less \
56+
ncdu \
57+
tig \
58+
git-annex-remote-rclone \
59+
octave \
5260
&& apt-get clean \
5361
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
5462

55-
# Add command(s) to entrypoint
5663
RUN sed -i '$isource /etc/fsl/fsl.sh' $ND_ENTRYPOINT
5764

58-
#----------------------
59-
# Install MCR and SPM12
60-
#----------------------
61-
# Install MATLAB Compiler Runtime
62-
RUN apt-get update -qq && apt-get install -yq --no-install-recommends libxext6 libxt6 \
65+
ENV FORCE_SPMMCR="1" \
66+
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu:/opt/matlabmcr-2018a/v94/runtime/glnxa64:/opt/matlabmcr-2018a/v94/bin/glnxa64:/opt/matlabmcr-2018a/v94/sys/os/glnxa64:/opt/matlabmcr-2018a/v94/extern/bin/glnxa64" \
67+
MATLABCMD="/opt/matlabmcr-2018a/v94/toolbox/matlab"
68+
RUN apt-get update -qq \
69+
&& apt-get install -y -q --no-install-recommends \
70+
bc \
71+
libxext6 \
72+
libxpm-dev \
73+
libxt6 \
6374
&& apt-get clean \
6475
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
6576
&& echo "Downloading MATLAB Compiler Runtime ..." \
66-
&& curl -sSL --retry 5 -o /tmp/mcr.zip https://www.mathworks.com/supportfiles/downloads/R2017a/deployment_files/R2017a/installers/glnxa64/MCR_R2017a_glnxa64_installer.zip \
77+
&& curl -fsSL --retry 5 -o /tmp/mcr.zip https://ssd.mathworks.com/supportfiles/downloads/R2018a/deployment_files/R2018a/installers/glnxa64/MCR_R2018a_glnxa64_installer.zip \
6778
&& unzip -q /tmp/mcr.zip -d /tmp/mcrtmp \
68-
&& /tmp/mcrtmp/install -destinationFolder /opt/mcr -mode silent -agreeToLicense yes \
69-
&& rm -rf /tmp/*
79+
&& /tmp/mcrtmp/install -destinationFolder /opt/matlabmcr-2018a -mode silent -agreeToLicense yes \
80+
&& rm -rf /tmp/* \
81+
&& echo "Downloading standalone SPM ..." \
82+
&& curl -fsSL --retry 5 -o /tmp/spm12.zip http://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/dev/spm12_latest_Linux_R2018a.zip \
83+
&& unzip -q /tmp/spm12.zip -d /tmp \
84+
&& mkdir -p /opt/spm12-dev \
85+
&& mv /tmp/spm12/* /opt/spm12-dev/ \
86+
&& chmod -R 777 /opt/spm12-dev \
87+
&& rm -rf /tmp/* \
88+
&& /opt/spm12-dev/run_spm12.sh /opt/matlabmcr-2018a/v94 quit \
89+
&& sed -i '$iexport SPMMCRCMD=\"/opt/spm12-dev/run_spm12.sh /opt/matlabmcr-2018a/v94 script\"' $ND_ENTRYPOINT
7090

71-
# Install standalone SPM
72-
RUN echo "Downloading standalone SPM ..." \
73-
&& curl -sSL --retry 5 -o spm.zip http://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/dev/spm12_latest_Linux_R2017a.zip \
74-
&& unzip -q spm.zip -d /opt \
75-
&& chmod -R 777 /opt/spm* \
76-
&& rm -rf spm.zip \
77-
&& /opt/spm12/run_spm12.sh /opt/mcr/v92/ quit \
78-
&& sed -i '$iexport SPMMCRCMD=\"/opt/spm12/run_spm12.sh /opt/mcr/v92/ script\"' $ND_ENTRYPOINT
79-
ENV MATLABCMD=/opt/mcr/v92/toolbox/matlab \
80-
FORCE_SPMMCR=1 \
81-
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/opt/mcr/v92/runtime/glnxa64:/opt/mcr/v92/bin/glnxa64:/opt/mcr/v92/sys/os/glnxa64:$LD_LIBRARY_PATH
82-
83-
# Create new user: neuro
8491
RUN useradd --no-user-group --create-home --shell /bin/bash neuro
8592
USER neuro
8693

87-
#------------------
88-
# Install Miniconda
89-
#------------------
90-
ENV CONDA_DIR=/opt/conda \
91-
PATH=/opt/conda/bin:$PATH
92-
RUN echo "Downloading Miniconda installer ..." \
93-
&& miniconda_installer=/tmp/miniconda.sh \
94-
&& curl -sSL --retry 5 -o $miniconda_installer https://repo.continuum.io/miniconda/Miniconda3-4.3.31-Linux-x86_64.sh \
95-
&& /bin/bash $miniconda_installer -b -p $CONDA_DIR \
96-
&& rm -f $miniconda_installer \
94+
ENV CONDA_DIR="/opt/miniconda-latest" \
95+
PATH="/opt/miniconda-latest/bin:$PATH"
96+
RUN export PATH="/opt/miniconda-latest/bin:$PATH" \
97+
&& echo "Downloading Miniconda installer ..." \
98+
&& conda_installer="/tmp/miniconda.sh" \
99+
&& curl -fsSL --retry 5 -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
100+
&& bash "$conda_installer" -b -p /opt/miniconda-latest \
101+
&& rm -f "$conda_installer" \
102+
&& conda update -yq -nbase conda \
97103
&& conda config --system --prepend channels conda-forge \
98104
&& conda config --system --set auto_update_conda false \
99105
&& conda config --system --set show_channel_urls true \
100-
&& conda clean -tipsy && sync
101-
102-
#-------------------------
103-
# Create conda environment
104-
#-------------------------
105-
RUN conda create -y -q --name neuro python=3.6 \
106-
pytest \
107-
jupyter \
108-
jupyterlab \
109-
jupyter_contrib_nbextensions \
110-
traits \
111-
pandas \
112-
matplotlib \
113-
scikit-learn \
114-
scikit-image \
115-
seaborn \
116-
nbformat \
117-
nb_conda \
118106
&& sync && conda clean -tipsy && sync \
119-
&& /bin/bash -c "source activate neuro \
120-
&& pip install -q --no-cache-dir https://github.com/nipy/nipype/tarball/master \
121-
https://github.com/INCF/pybids/tarball/master \
122-
nilearn \
123-
datalad[full] \
124-
nipy \
125-
duecredit" \
107+
&& conda create -y -q --name neuro \
108+
&& conda install -y -q --name neuro \
109+
python=3.6 \
110+
pytest \
111+
jupyter \
112+
jupyterlab \
113+
jupyter_contrib_nbextensions \
114+
traits \
115+
pandas \
116+
matplotlib \
117+
scikit-learn \
118+
scikit-image \
119+
seaborn \
120+
nbformat \
121+
nb_conda \
122+
&& sync && conda clean -tipsy && sync \
123+
&& bash -c "source activate neuro \
124+
&& pip install --no-cache-dir \
125+
https://github.com/nipy/nipype/tarball/master \
126+
https://github.com/INCF/pybids/tarball/master \
127+
nilearn \
128+
datalad[full] \
129+
nipy \
130+
duecredit" \
131+
&& rm -rf ~/.cache/pip/* \
126132
&& sync \
127133
&& sed -i '$isource activate neuro' $ND_ENTRYPOINT
128134

129-
# User-defined BASH instruction
130-
RUN bash -c "source activate neuro && jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main"
135+
RUN bash -c 'source activate neuro && jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main'
131136

132137
USER root
133138

134-
# User-defined instruction
135139
RUN mkdir /data && chmod 777 /data && chmod a+s /data
136140

137-
# User-defined instruction
138141
RUN mkdir /output && chmod 777 /output && chmod a+s /output
139142

140143
USER neuro
141144

142-
# User-defined instruction
143145
RUN printf "[user]\n\tname = miykael\n\temail = [email protected]\n" > ~/.gitconfig
144146

145-
# User-defined BASH instruction
146-
RUN bash -c "source activate neuro && cd /data && datalad install -r ///workshops/nih-2017/ds000114 && cd ds000114 && datalad update -r && datalad get -r sub-01/ses-test/anat sub-01/ses-test/func/*fingerfootlips*"
147+
RUN bash -c 'source activate neuro && cd /data && datalad install -r ///workshops/nih-2017/ds000114 && cd ds000114 && datalad update -r && datalad get -r sub-01/ses-test/anat sub-01/ses-test/func/*fingerfootlips*'
147148

148-
# User-defined instruction
149149
RUN curl -L https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/580705089ad5a101f17944a9 -o /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz && tar xf /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz -C /data/ds000114/derivatives/fmriprep/. && rm /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c.tar.gz && find /data/ds000114/derivatives/fmriprep/mni_icbm152_nlin_asym_09c -type f -not -name ?mm_T1.nii.gz -not -name ?mm_brainmask.nii.gz -not -name ?mm_tpm*.nii.gz -delete
150150

151151
COPY [".", "/home/neuro/nipype_tutorial"]
152152

153153
USER root
154154

155-
# User-defined instruction
156155
RUN chown -R neuro /home/neuro/nipype_tutorial
157156

158-
# User-defined instruction
159157
RUN rm -rf /opt/conda/pkgs/*
160158

161159
USER neuro
162160

163-
# User-defined instruction
164161
RUN mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py
165162

166163
WORKDIR /home/neuro/nipype_tutorial
167164

168165
CMD ["jupyter-notebook"]
169166

170-
#--------------------------------------
171-
# Save container specifications to JSON
172-
#--------------------------------------
173167
RUN echo '{ \
174168
\n "pkg_manager": "apt", \
175-
\n "check_urls": false, \
176169
\n "instructions": [ \
177170
\n [ \
178171
\n "base", \
@@ -201,15 +194,12 @@ RUN echo '{ \
201194
\n ], \
202195
\n [ \
203196
\n "add_to_entrypoint", \
204-
\n [ \
205-
\n "source /etc/fsl/fsl.sh" \
206-
\n ] \
197+
\n "source /etc/fsl/fsl.sh" \
207198
\n ], \
208199
\n [ \
209-
\n "spm", \
200+
\n "spm12", \
210201
\n { \
211-
\n "version": "12", \
212-
\n "matlab_version": "R2017a" \
202+
\n "version": "dev" \
213203
\n } \
214204
\n ], \
215205
\n [ \
@@ -220,9 +210,30 @@ RUN echo '{ \
220210
\n "miniconda", \
221211
\n { \
222212
\n "miniconda_version": "4.3.31", \
223-
\n "conda_install": "python=3.6 pytest jupyter jupyterlab jupyter_contrib_nbextensions traits pandas matplotlib scikit-learn scikit-image seaborn nbformat nb_conda", \
224-
\n "pip_install": "https://github.com/nipy/nipype/tarball/master https://github.com/INCF/pybids/tarball/master nilearn datalad[full] nipy duecredit", \
225-
\n "env_name": "neuro", \
213+
\n "conda_install": [ \
214+
\n "python=3.6", \
215+
\n "pytest", \
216+
\n "jupyter", \
217+
\n "jupyterlab", \
218+
\n "jupyter_contrib_nbextensions", \
219+
\n "traits", \
220+
\n "pandas", \
221+
\n "matplotlib", \
222+
\n "scikit-learn", \
223+
\n "scikit-image", \
224+
\n "seaborn", \
225+
\n "nbformat", \
226+
\n "nb_conda" \
227+
\n ], \
228+
\n "pip_install": [ \
229+
\n "https://github.com/nipy/nipype/tarball/master", \
230+
\n "https://github.com/INCF/pybids/tarball/master", \
231+
\n "nilearn", \
232+
\n "datalad[full]", \
233+
\n "nipy", \
234+
\n "duecredit" \
235+
\n ], \
236+
\n "create_env": "neuro", \
226237
\n "activate": true \
227238
\n } \
228239
\n ], \
@@ -295,7 +306,5 @@ RUN echo '{ \
295306
\n "jupyter-notebook" \
296307
\n ] \
297308
\n ] \
298-
\n ], \
299-
\n "generation_timestamp": "2018-05-16 09:31:36", \
300-
\n "neurodocker_version": "0.3.2" \
309+
\n ] \
301310
\n}' > /neurodocker/neurodocker_specs.json

create_dockerfile.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
#!/bin/bash
22

3-
docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
3+
docker run --rm kaczmarj/neurodocker:master generate docker\
44
--base neurodebian:stretch-non-free \
55
--pkg-manager apt \
66
--install convert3d ants fsl gcc g++ graphviz tree \
77
git-annex-standalone vim emacs-nox nano less ncdu \
88
tig git-annex-remote-rclone octave \
99
--add-to-entrypoint "source /etc/fsl/fsl.sh" \
10-
--spm version=12 matlab_version=R2017a \
10+
--spm12 version=dev \
1111
--user=neuro \
1212
--miniconda miniconda_version="4.3.31" \
1313
conda_install="python=3.6 pytest jupyter jupyterlab jupyter_contrib_nbextensions
1414
traits pandas matplotlib scikit-learn scikit-image seaborn nbformat nb_conda" \
1515
pip_install="https://github.com/nipy/nipype/tarball/master
1616
https://github.com/INCF/pybids/tarball/master
1717
nilearn datalad[full] nipy duecredit" \
18-
env_name="neuro" \
18+
create_env="neuro" \
1919
activate=True \
2020
--run-bash "source activate neuro && jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main" \
2121
--user=root \
@@ -32,5 +32,4 @@ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
3232
--user=neuro \
3333
--run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' \
3434
--workdir /home/neuro/nipype_tutorial \
35-
--cmd "jupyter-notebook" \
36-
--no-check-urls > Dockerfile
35+
--cmd "jupyter-notebook" > Dockerfile

0 commit comments

Comments
 (0)