@@ -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 --help
2624
27251. Users must specify a base Docker image and the package manager. Any Docker
2826 image on DockerHub can be used as your base image. Common base images
@@ -37,20 +35,32 @@ To view the Neurodocker help message
3735 machine into the container, and other operations. The list of supported
3836 neuroimaging software packages is available in the ``neurodocker `` help
3937 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.
4242
4343
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+ --------------------------------------------------------------------------
4646
4747This command prints a Dockerfile (the specification for a Docker image) to the
4848terminal.
4949::
50- $ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
50+ $ docker run --rm kaczmarj/neurodocker:0.4.0 generate docker \
5151 --base debian:stretch --pkg-manager apt \
5252 --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 \
5464 conda_install="python=3.6 traits" \
5565 pip_install="nipype"
5666
@@ -60,24 +70,38 @@ Build the Docker image
6070
6171The Dockerfile can be saved and used to build the Docker image
6272::
63- $ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
73+ $ docker run --rm kaczmarj/neurodocker:0.4.0 generate docker \
6474 --base debian:stretch --pkg-manager apt \
6575 --fsl version=5.0.10 \
66- --miniconda env_name =neuro \
76+ --miniconda create_env =neuro \
6777 conda_install="python=3.6 traits" \
6878 pip_install="nipype" > Dockerfile
6979 $ docker build --tag my_image .
7080 $ # or
7181 $ docker build --tag my_image - < Dockerfile
7282
7383
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+
7498Use NeuroDebian
7599---------------
76100
77101This example installs AFNI and ANTs from the NeuroDebian repositories. It also
78102installs ``git `` and ``vim ``.
79103::
80- $ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
104+ $ docker run --rm kaczmarj/neurodocker:0.4.0 generate [docker|singularity] \
81105 --base neurodebian:stretch --pkg-manager apt \
82106 --install afni ants git vim
83107
@@ -94,18 +118,18 @@ Create a container with ``dcm2niix``, Nipype, and jupyter notebook. Install
94118Miniconda as a non-root user, and activate the Miniconda environment upon
95119running the container.
96120::
97- $ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
121+ $ docker run --rm kaczmarj/neurodocker:0.4.0 generate docker \
98122 --base centos:7 --pkg-manager yum \
99123 --dcm2niix version=master \
100124 --user neuro \
101- --miniconda env_name =neuro conda_install="jupyter traits nipype" \
125+ --miniconda create_env =neuro conda_install="jupyter traits nipype" \
102126 > Dockerfile
103127 $ docker build --tag my_nipype - < Dockerfile
104128
105129
106130Copy local files into a container.
107131::
108- $ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
132+ $ docker run --rm kaczmarj/neurodocker:v0.3.2 generate [docker|singularity] \
109133 --base ubuntu:16.04 --pkg-manager apt \
110134 --copy relative/path/to/source.txt /absolute/path/to/destination.txt
111135
0 commit comments