Skip to content

Commit e7e7510

Browse files
authored
Merge pull request #2647 from kaczmarj/docs/neurodocker
DOC: update neurodocker tutorial for neurodocker version 0.4.0
2 parents c505903 + 3c937b7 commit e7e7510

File tree

2 files changed

+40
-21
lines changed

2 files changed

+40
-21
lines changed

doc/links_names.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@
105105
.. _mingw: http://www.mingw.org
106106
.. _macports: http://www.macports.org/
107107
.. _Vagrant: http://www.vagrantup.com/
108-
.. _Docker: http://www.docker.io/
109-
.. _Singularity: http://singularity.lbl.gov/
108+
.. _Docker: http://www.docker.com/
109+
.. _Singularity: https://www.sylabs.io/singularity/
110110
.. _Virtualbox: https://www.virtualbox.org/
111111

112112
.. Functional imaging labs

doc/users/neurodocker.rst

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ Neurodocker tutorial
77
This page covers the steps to create containers with Neurodocker_.
88

99
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.
1311

1412
Requirements:
1513

16-
* Docker_
14+
* Docker_ or Singularity_
1715
* Internet connection
1816

1917

@@ -22,7 +20,9 @@ Usage
2220

2321
To view the Neurodocker help message
2422
::
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]``.
2626

2727
1. Users must specify a base Docker image and the package manager. Any Docker
2828
image on DockerHub can be used as your base image. Common base images
@@ -37,20 +37,23 @@ To view the Neurodocker help message
3737
machine into the container, and other operations. The list of supported
3838
neuroimaging software packages is available in the ``neurodocker`` help
3939
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.
4244

4345

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+
--------------------------------------------------------------------------
4648

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
4851
terminal.
4952
::
50-
$ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
53+
$ docker run --rm kaczmarj/neurodocker:0.4.0 generate [docker|singularity] \
5154
--base debian:stretch --pkg-manager apt \
5255
--fsl version=5.0.10 \
53-
--miniconda env_name=neuro \
56+
--miniconda create_env=neuro \
5457
conda_install="python=3.6 traits" \
5558
pip_install="nipype"
5659

@@ -60,24 +63,38 @@ Build the Docker image
6063

6164
The Dockerfile can be saved and used to build the Docker image
6265
::
63-
$ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
66+
$ docker run --rm kaczmarj/neurodocker:0.4.0 generate docker \
6467
--base debian:stretch --pkg-manager apt \
6568
--fsl version=5.0.10 \
66-
--miniconda env_name=neuro \
69+
--miniconda create_env=neuro \
6770
conda_install="python=3.6 traits" \
6871
pip_install="nipype" > Dockerfile
6972
$ docker build --tag my_image .
7073
$ # or
7174
$ docker build --tag my_image - < Dockerfile
7275

7376

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+
7491
Use NeuroDebian
7592
---------------
7693

7794
This example installs AFNI and ANTs from the NeuroDebian repositories. It also
7895
installs ``git`` and ``vim``.
7996
::
80-
$ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
97+
$ docker run --rm kaczmarj/neurodocker:0.4.0 generate [docker|singularity] \
8198
--base neurodebian:stretch --pkg-manager apt \
8299
--install afni ants git vim
83100

@@ -94,19 +111,21 @@ Create a container with ``dcm2niix``, Nipype, and jupyter notebook. Install
94111
Miniconda as a non-root user, and activate the Miniconda environment upon
95112
running the container.
96113
::
97-
$ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
114+
$ docker run --rm kaczmarj/neurodocker:0.4.0 generate docker \
98115
--base centos:7 --pkg-manager yum \
99-
--dcm2niix version=master \
116+
--dcm2niix version=master method=source \
100117
--user neuro \
101-
--miniconda env_name=neuro conda_install="jupyter traits nipype" \
118+
--miniconda create_env=neuro conda_install="jupyter traits nipype" \
102119
> Dockerfile
103120
$ docker build --tag my_nipype - < Dockerfile
104121

105122

106123
Copy local files into a container.
107124
::
108-
$ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
125+
$ docker run --rm kaczmarj/neurodocker:0.4.0 generate [docker|singularity] \
109126
--base ubuntu:16.04 --pkg-manager apt \
110127
--copy relative/path/to/source.txt /absolute/path/to/destination.txt
111128

129+
See the `Neurodocker examples page <https://github.com/kaczmarj/neurodocker/tree/master/examples/>`_ for more.
130+
112131
.. include:: ../links_names.txt

0 commit comments

Comments
 (0)