@@ -7,13 +7,11 @@ Neurodocker tutorial
7
7
This page covers the steps to create containers with Neurodocker _.
8
8
9
9
Neurodocker _ is a command-line program that enables users to generate Docker _
10
- containers that include neuroimaging software. These containers can be
11
- converted to Singularity _ containers for use in high-performance computing
12
- centers.
10
+ containers and Singularity _ images that include neuroimaging software.
13
11
14
12
Requirements:
15
13
16
- * Docker _
14
+ * Docker _ or Singularity _
17
15
* Internet connection
18
16
19
17
22
20
23
21
To view the Neurodocker help message
24
22
::
25
- docker run --rm kaczmarj/neurodocker:v0.3.2 generate --help
23
+ docker run --rm kaczmarj/neurodocker:0.4.0 generate [docker|singularity] --help
24
+
25
+ Note: choose between ``docker `` and ``singularity `` in ``[docker|singularity] ``.
26
26
27
27
1. Users must specify a base Docker image and the package manager. Any Docker
28
28
image on DockerHub can be used as your base image. Common base images
@@ -37,20 +37,23 @@ To view the Neurodocker help message
37
37
machine into the container, and other operations. The list of supported
38
38
neuroimaging software packages is available in the ``neurodocker `` help
39
39
message.
40
- 3. The ``neurodocker `` command will generate a Dockerfile. This Dockerfile can
41
- be used to build a Docker image with the ``docker build `` command.
40
+ 3. The ``neurodocker `` command will generate a Dockerfile or Singularity recipe.
41
+ The Dockerfile can be used with the ``docker build `` command to build a
42
+ Docker image. The Singularity recipe can be used to build a Singularity
43
+ container with the ``singularity build `` command.
42
44
43
45
44
- Create a Dockerfile with FSL, Python 3.6, and Nipype
45
- ----------------------------------------------------
46
+ Create a Dockerfile or Singularity recipe with FSL, Python 3.6, and Nipype
47
+ --------------------------------------------------------------------------
46
48
47
- This command prints a Dockerfile (the specification for a Docker image) to the
49
+ This command prints a Dockerfile (the specification for a Docker image) or a
50
+ Singularity recipe (the specification for a Singularity container) to the
48
51
terminal.
49
52
::
50
- $ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
53
+ $ docker run --rm kaczmarj/neurodocker:0.4.0 generate [docker|singularity] \
51
54
--base debian:stretch --pkg-manager apt \
52
55
--fsl version=5.0.10 \
53
- --miniconda env_name =neuro \
56
+ --miniconda create_env =neuro \
54
57
conda_install="python=3.6 traits" \
55
58
pip_install="nipype"
56
59
@@ -60,24 +63,38 @@ Build the Docker image
60
63
61
64
The Dockerfile can be saved and used to build the Docker image
62
65
::
63
- $ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
66
+ $ docker run --rm kaczmarj/neurodocker:0.4.0 generate docker \
64
67
--base debian:stretch --pkg-manager apt \
65
68
--fsl version=5.0.10 \
66
- --miniconda env_name =neuro \
69
+ --miniconda create_env =neuro \
67
70
conda_install="python=3.6 traits" \
68
71
pip_install="nipype" > Dockerfile
69
72
$ docker build --tag my_image .
70
73
$ # or
71
74
$ docker build --tag my_image - < Dockerfile
72
75
73
76
77
+ Build the Singularity container
78
+ -------------------------------
79
+
80
+ The Singularity recipe can be saved and used to build the Singularity container
81
+ ::
82
+ $ docker run --rm kaczmarj/neurodocker:0.4.0 generate singularity \
83
+ --base debian:stretch --pkg-manager apt \
84
+ --fsl version=5.0.10 \
85
+ --miniconda create_env=neuro \
86
+ conda_install="python=3.6 traits" \
87
+ pip_install="nipype" > Singularity
88
+ $ singularity build my_nipype.simg Singularity
89
+
90
+
74
91
Use NeuroDebian
75
92
---------------
76
93
77
94
This example installs AFNI and ANTs from the NeuroDebian repositories. It also
78
95
installs ``git `` and ``vim ``.
79
96
::
80
- $ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
97
+ $ docker run --rm kaczmarj/neurodocker:0.4.0 generate [docker|singularity] \
81
98
--base neurodebian:stretch --pkg-manager apt \
82
99
--install afni ants git vim
83
100
@@ -94,19 +111,21 @@ Create a container with ``dcm2niix``, Nipype, and jupyter notebook. Install
94
111
Miniconda as a non-root user, and activate the Miniconda environment upon
95
112
running the container.
96
113
::
97
- $ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
114
+ $ docker run --rm kaczmarj/neurodocker:0.4.0 generate docker \
98
115
--base centos:7 --pkg-manager yum \
99
- --dcm2niix version=master \
116
+ --dcm2niix version=master method=source \
100
117
--user neuro \
101
- --miniconda env_name =neuro conda_install="jupyter traits nipype" \
118
+ --miniconda create_env =neuro conda_install="jupyter traits nipype" \
102
119
> Dockerfile
103
120
$ docker build --tag my_nipype - < Dockerfile
104
121
105
122
106
123
Copy local files into a container.
107
124
::
108
- $ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
125
+ $ docker run --rm kaczmarj/neurodocker:0.4.0 generate [docker|singularity] \
109
126
--base ubuntu:16.04 --pkg-manager apt \
110
127
--copy relative/path/to/source.txt /absolute/path/to/destination.txt
111
128
129
+ See the `Neurodocker examples page <https://github.com/kaczmarj/neurodocker/tree/master/examples/ >`_ for more.
130
+
112
131
.. include :: ../links_names.txt
0 commit comments