Skip to content

Commit d80bf15

Browse files
authored
Merge pull request miykael#90 from miykael/correct_jupyter_notebook_ip
Correct jupyter notebook ip issue
2 parents 0bffc1a + 9fb9c7e commit d80bf15

File tree

2 files changed

+65
-63
lines changed

2 files changed

+65
-63
lines changed

Dockerfile

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# pull request on our GitHub repository:
66
# https://github.com/kaczmarj/neurodocker
77
#
8-
# Timestamp: 2018-05-14 11:52:36
8+
# Timestamp: 2018-05-16 09:31:36
99

1010
FROM neurodebian:stretch-non-free
1111

@@ -129,40 +129,40 @@ RUN conda create -y -q --name neuro python=3.6 \
129129
# User-defined BASH instruction
130130
RUN bash -c "source activate neuro && jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main"
131131

132-
# User-defined BASH instruction
133-
RUN bash -c "mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \\"0.0.0.0\\" > ~/.jupyter/jupyter_notebook_config.py"
134-
135132
USER root
136133

137-
# User-defined BASH instruction
138-
RUN bash -c "mkdir /data && chmod 777 /data && chmod a+s /data"
134+
# User-defined instruction
135+
RUN mkdir /data && chmod 777 /data && chmod a+s /data
139136

140-
# User-defined BASH instruction
141-
RUN bash -c "mkdir /output && chmod 777 /output && chmod a+s /output"
137+
# User-defined instruction
138+
RUN mkdir /output && chmod 777 /output && chmod a+s /output
142139

143140
USER neuro
144141

142+
# User-defined instruction
143+
RUN printf "[user]\n\tname = miykael\n\temail = [email protected]\n" > ~/.gitconfig
144+
145145
# User-defined BASH instruction
146146
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*"
147147

148-
# User-defined BASH instruction
149-
RUN bash -c "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"
148+
# User-defined instruction
149+
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

153-
# User-defined BASH instruction
154-
RUN bash -c "printf \"[user]\n\tname = miykael\n\temail = [email protected]\n\" > ~/.gitconfig"
155-
156153
USER root
157154

158-
# User-defined BASH instruction
159-
RUN bash -c "chown -R neuro /home/neuro/nipype_tutorial"
155+
# User-defined instruction
156+
RUN chown -R neuro /home/neuro/nipype_tutorial
160157

161-
# User-defined BASH instruction
162-
RUN bash -c "rm -rf /opt/conda/pkgs/*"
158+
# User-defined instruction
159+
RUN rm -rf /opt/conda/pkgs/*
163160

164161
USER neuro
165162

163+
# User-defined instruction
164+
RUN mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py
165+
166166
WORKDIR /home/neuro/nipype_tutorial
167167

168168
CMD ["jupyter-notebook"]
@@ -231,31 +231,31 @@ RUN echo '{ \
231231
\n "source activate neuro && jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main" \
232232
\n ], \
233233
\n [ \
234-
\n "run_bash", \
235-
\n "mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \\\"0.0.0.0\\\" > ~/.jupyter/jupyter_notebook_config.py" \
236-
\n ], \
237-
\n [ \
238234
\n "user", \
239235
\n "root" \
240236
\n ], \
241237
\n [ \
242-
\n "run_bash", \
238+
\n "run", \
243239
\n "mkdir /data && chmod 777 /data && chmod a+s /data" \
244240
\n ], \
245241
\n [ \
246-
\n "run_bash", \
242+
\n "run", \
247243
\n "mkdir /output && chmod 777 /output && chmod a+s /output" \
248244
\n ], \
249245
\n [ \
250246
\n "user", \
251247
\n "neuro" \
252248
\n ], \
253249
\n [ \
250+
\n "run", \
251+
\n "printf \"[user]\\\n\\tname = miykael\\\n\\temail = [email protected]\\\n\" > ~/.gitconfig" \
252+
\n ], \
253+
\n [ \
254254
\n "run_bash", \
255255
\n "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*" \
256256
\n ], \
257257
\n [ \
258-
\n "run_bash", \
258+
\n "run", \
259259
\n "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" \
260260
\n ], \
261261
\n [ \
@@ -266,26 +266,26 @@ RUN echo '{ \
266266
\n ] \
267267
\n ], \
268268
\n [ \
269-
\n "run_bash", \
270-
\n "printf \"[user]\\\n\\tname = miykael\\\n\\temail = [email protected]\\\n\" > ~/.gitconfig" \
271-
\n ], \
272-
\n [ \
273269
\n "user", \
274270
\n "root" \
275271
\n ], \
276272
\n [ \
277-
\n "run_bash", \
273+
\n "run", \
278274
\n "chown -R neuro /home/neuro/nipype_tutorial" \
279275
\n ], \
280276
\n [ \
281-
\n "run_bash", \
277+
\n "run", \
282278
\n "rm -rf /opt/conda/pkgs/*" \
283279
\n ], \
284280
\n [ \
285281
\n "user", \
286282
\n "neuro" \
287283
\n ], \
288284
\n [ \
285+
\n "run", \
286+
\n "mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \\\"0.0.0.0\\\" > ~/.jupyter/jupyter_notebook_config.py" \
287+
\n ], \
288+
\n [ \
289289
\n "workdir", \
290290
\n "/home/neuro/nipype_tutorial" \
291291
\n ], \
@@ -296,6 +296,6 @@ RUN echo '{ \
296296
\n ] \
297297
\n ] \
298298
\n ], \
299-
\n "generation_timestamp": "2018-05-14 11:52:36", \
299+
\n "generation_timestamp": "2018-05-16 09:31:36", \
300300
\n "neurodocker_version": "0.3.2" \
301301
\n}' > /neurodocker/neurodocker_specs.json

create_dockerfile.sh

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
11
#!/bin/bash
22

3-
docker run --rm kaczmarj/neurodocker:v0.3.2 generate -b neurodebian:stretch-non-free -p apt \
4-
--install convert3d ants fsl gcc g++ graphviz tree \
5-
git-annex-standalone vim emacs-nox nano less ncdu \
6-
tig git-annex-remote-rclone octave \
7-
--add-to-entrypoint "source /etc/fsl/fsl.sh" \
8-
--spm version=12 matlab_version=R2017a \
9-
--user=neuro \
10-
--miniconda miniconda_version="4.3.31" \
11-
conda_install="python=3.6 pytest jupyter jupyterlab jupyter_contrib_nbextensions
12-
traits pandas matplotlib scikit-learn scikit-image seaborn nbformat nb_conda" \
13-
pip_install="https://github.com/nipy/nipype/tarball/master
14-
https://github.com/INCF/pybids/tarball/master
15-
nilearn datalad[full] nipy duecredit" \
16-
env_name="neuro" \
17-
activate=True \
18-
--run-bash "source activate neuro && jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main" \
19-
--run-bash 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' \
20-
--user=root \
21-
--run-bash 'mkdir /data && chmod 777 /data && chmod a+s /data' \
22-
--run-bash 'mkdir /output && chmod 777 /output && chmod a+s /output' \
23-
--user=neuro \
24-
--run-bash '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*' \
25-
--run-bash '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' \
26-
--copy . "/home/neuro/nipype_tutorial" \
27-
--run-bash 'printf "[user]\n\tname = miykael\n\temail = [email protected]\n" > ~/.gitconfig' \
28-
--user=root \
29-
--run-bash 'chown -R neuro /home/neuro/nipype_tutorial' \
30-
--run-bash 'rm -rf /opt/conda/pkgs/*' \
31-
--user=neuro \
32-
--workdir /home/neuro/nipype_tutorial \
33-
--cmd "jupyter-notebook" \
34-
--no-check-urls > Dockerfile
3+
docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
4+
--base neurodebian:stretch-non-free \
5+
--pkg-manager apt \
6+
--install convert3d ants fsl gcc g++ graphviz tree \
7+
git-annex-standalone vim emacs-nox nano less ncdu \
8+
tig git-annex-remote-rclone octave \
9+
--add-to-entrypoint "source /etc/fsl/fsl.sh" \
10+
--spm version=12 matlab_version=R2017a \
11+
--user=neuro \
12+
--miniconda miniconda_version="4.3.31" \
13+
conda_install="python=3.6 pytest jupyter jupyterlab jupyter_contrib_nbextensions
14+
traits pandas matplotlib scikit-learn scikit-image seaborn nbformat nb_conda" \
15+
pip_install="https://github.com/nipy/nipype/tarball/master
16+
https://github.com/INCF/pybids/tarball/master
17+
nilearn datalad[full] nipy duecredit" \
18+
env_name="neuro" \
19+
activate=True \
20+
--run-bash "source activate neuro && jupyter nbextension enable exercise2/main && jupyter nbextension enable spellchecker/main" \
21+
--user=root \
22+
--run 'mkdir /data && chmod 777 /data && chmod a+s /data' \
23+
--run 'mkdir /output && chmod 777 /output && chmod a+s /output' \
24+
--user=neuro \
25+
--run 'printf "[user]\n\tname = miykael\n\temail = [email protected]\n" > ~/.gitconfig' \
26+
--run-bash '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*' \
27+
--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' \
28+
--copy . "/home/neuro/nipype_tutorial" \
29+
--user=root \
30+
--run 'chown -R neuro /home/neuro/nipype_tutorial' \
31+
--run 'rm -rf /opt/conda/pkgs/*' \
32+
--user=neuro \
33+
--run 'mkdir -p ~/.jupyter && echo c.NotebookApp.ip = \"0.0.0.0\" > ~/.jupyter/jupyter_notebook_config.py' \
34+
--workdir /home/neuro/nipype_tutorial \
35+
--cmd "jupyter-notebook" \
36+
--no-check-urls > Dockerfile

0 commit comments

Comments
 (0)