@@ -7,13 +7,11 @@ Neurodocker tutorial
77This page covers the steps to create containers with Neurodocker _.
88
99Neurodocker _ 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
1412Requirements:
1513
16- * Docker _
14+ * Docker _ or Singularity _
1715* Internet connection
1816
1917
2220
2321To 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
27271. 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
4851terminal.
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
6164The 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+
7491Use NeuroDebian
7592---------------
7693
7794This example installs AFNI and ANTs from the NeuroDebian repositories. It also
7895installs ``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
94111Miniconda as a non-root user, and activate the Miniconda environment upon
95112running 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
106123Copy 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