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