@@ -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 --help
26
24
27
25
1. Users must specify a base Docker image and the package manager. Any Docker
28
26
image on DockerHub can be used as your base image. Common base images
@@ -37,20 +35,32 @@ To view the Neurodocker help message
37
35
machine into the container, and other operations. The list of supported
38
36
neuroimaging software packages is available in the ``neurodocker `` help
39
37
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.
38
+ 3. The ``neurodocker `` command will generate a Dockerfile or Singularity recipe.
39
+ The Dockerfile can be used with the ``docker build `` command to build a
40
+ Docker image. The Singularity recipe can be used to build a Singularity
41
+ container with the ``singularity build `` command.
42
42
43
43
44
- Create a Dockerfile with FSL, Python 3.6, and Nipype
45
- ----------------------------------------------------
44
+ Create a Dockerfile or Singularity recipe with FSL, Python 3.6, and Nipype
45
+ --------------------------------------------------------------------------
46
46
47
47
This command prints a Dockerfile (the specification for a Docker image) to the
48
48
terminal.
49
49
::
50
- $ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
50
+ $ docker run --rm kaczmarj/neurodocker:0.4.0 generate docker \
51
51
--base debian:stretch --pkg-manager apt \
52
52
--fsl version=5.0.10 \
53
- --miniconda env_name=neuro \
53
+ --miniconda create_env=neuro \
54
+ conda_install="python=3.6 traits" \
55
+ pip_install="nipype"
56
+
57
+ This command prints a Singularity recipe (the specification for a Singularity
58
+ container) to the terminal.
59
+ ::
60
+ $ docker run --rm kaczmarj/neurodocker:0.4.0 generate singularity \
61
+ --base debian:stretch --pkg-manager apt \
62
+ --fsl version=5.0.10 \
63
+ --miniconda create_env=neuro \
54
64
conda_install="python=3.6 traits" \
55
65
pip_install="nipype"
56
66
@@ -60,24 +70,38 @@ Build the Docker image
60
70
61
71
The Dockerfile can be saved and used to build the Docker image
62
72
::
63
- $ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
73
+ $ docker run --rm kaczmarj/neurodocker:0.4.0 generate docker \
64
74
--base debian:stretch --pkg-manager apt \
65
75
--fsl version=5.0.10 \
66
- --miniconda env_name =neuro \
76
+ --miniconda create_env =neuro \
67
77
conda_install="python=3.6 traits" \
68
78
pip_install="nipype" > Dockerfile
69
79
$ docker build --tag my_image .
70
80
$ # or
71
81
$ docker build --tag my_image - < Dockerfile
72
82
73
83
84
+ Build the Singularity container
85
+ -------------------------------
86
+
87
+ The Singularity recipe can be saved and used to build the Singularity container
88
+ ::
89
+ $ docker run --rm kaczmarj/neurodocker:0.4.0 generate singularity \
90
+ --base debian:stretch --pkg-manager apt \
91
+ --fsl version=5.0.10 \
92
+ --miniconda create_env=neuro \
93
+ conda_install="python=3.6 traits" \
94
+ pip_install="nipype" > Singularity
95
+ $ singularity build Singularity my_nipype.sqsh
96
+
97
+
74
98
Use NeuroDebian
75
99
---------------
76
100
77
101
This example installs AFNI and ANTs from the NeuroDebian repositories. It also
78
102
installs ``git `` and ``vim ``.
79
103
::
80
- $ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
104
+ $ docker run --rm kaczmarj/neurodocker:0.4.0 generate [docker|singularity] \
81
105
--base neurodebian:stretch --pkg-manager apt \
82
106
--install afni ants git vim
83
107
@@ -94,18 +118,18 @@ Create a container with ``dcm2niix``, Nipype, and jupyter notebook. Install
94
118
Miniconda as a non-root user, and activate the Miniconda environment upon
95
119
running the container.
96
120
::
97
- $ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
121
+ $ docker run --rm kaczmarj/neurodocker:0.4.0 generate docker \
98
122
--base centos:7 --pkg-manager yum \
99
123
--dcm2niix version=master \
100
124
--user neuro \
101
- --miniconda env_name =neuro conda_install="jupyter traits nipype" \
125
+ --miniconda create_env =neuro conda_install="jupyter traits nipype" \
102
126
> Dockerfile
103
127
$ docker build --tag my_nipype - < Dockerfile
104
128
105
129
106
130
Copy local files into a container.
107
131
::
108
- $ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
132
+ $ docker run --rm kaczmarj/neurodocker:v0.3.2 generate [docker|singularity] \
109
133
--base ubuntu:16.04 --pkg-manager apt \
110
134
--copy relative/path/to/source.txt /absolute/path/to/destination.txt
111
135
0 commit comments