Skip to content

DOC: update neurodocker tutorial for neurodocker version 0.4.0 #2647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/links_names.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@
.. _mingw: http://www.mingw.org
.. _macports: http://www.macports.org/
.. _Vagrant: http://www.vagrantup.com/
.. _Docker: http://www.docker.io/
.. _Singularity: http://singularity.lbl.gov/
.. _Docker: http://www.docker.com/
.. _Singularity: https://www.sylabs.io/singularity/
.. _Virtualbox: https://www.virtualbox.org/

.. Functional imaging labs
Expand Down
57 changes: 38 additions & 19 deletions doc/users/neurodocker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ Neurodocker tutorial
This page covers the steps to create containers with Neurodocker_.

Neurodocker_ is a command-line program that enables users to generate Docker_
containers that include neuroimaging software. These containers can be
converted to Singularity_ containers for use in high-performance computing
centers.
containers and Singularity_ images that include neuroimaging software.

Requirements:

* Docker_
* Docker_ or Singularity_
* Internet connection


Expand All @@ -22,7 +20,9 @@ Usage

To view the Neurodocker help message
::
docker run --rm kaczmarj/neurodocker:v0.3.2 generate --help
docker run --rm kaczmarj/neurodocker:0.4.0 generate [docker|singularity] --help

Note: choose between ``docker`` and ``singularity`` in ``[docker|singularity]``.

1. Users must specify a base Docker image and the package manager. Any Docker
image on DockerHub can be used as your base image. Common base images
Expand All @@ -37,20 +37,23 @@ To view the Neurodocker help message
machine into the container, and other operations. The list of supported
neuroimaging software packages is available in the ``neurodocker`` help
message.
3. The ``neurodocker`` command will generate a Dockerfile. This Dockerfile can
be used to build a Docker image with the ``docker build`` command.
3. The ``neurodocker`` command will generate a Dockerfile or Singularity recipe.
The Dockerfile can be used with the ``docker build`` command to build a
Docker image. The Singularity recipe can be used to build a Singularity
container with the ``singularity build`` command.


Create a Dockerfile with FSL, Python 3.6, and Nipype
----------------------------------------------------
Create a Dockerfile or Singularity recipe with FSL, Python 3.6, and Nipype
--------------------------------------------------------------------------

This command prints a Dockerfile (the specification for a Docker image) to the
This command prints a Dockerfile (the specification for a Docker image) or a
Singularity recipe (the specification for a Singularity container) to the
terminal.
::
$ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
$ docker run --rm kaczmarj/neurodocker:0.4.0 generate [docker|singularity] \
--base debian:stretch --pkg-manager apt \
--fsl version=5.0.10 \
--miniconda env_name=neuro \
--miniconda create_env=neuro \
conda_install="python=3.6 traits" \
pip_install="nipype"

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

The Dockerfile can be saved and used to build the Docker image
::
$ docker run --rm kaczmarj/neurodocker:v0.3.2 generate \
$ docker run --rm kaczmarj/neurodocker:0.4.0 generate docker \
--base debian:stretch --pkg-manager apt \
--fsl version=5.0.10 \
--miniconda env_name=neuro \
--miniconda create_env=neuro \
conda_install="python=3.6 traits" \
pip_install="nipype" > Dockerfile
$ docker build --tag my_image .
$ # or
$ docker build --tag my_image - < Dockerfile


Build the Singularity container
-------------------------------

The Singularity recipe can be saved and used to build the Singularity container
::
$ docker run --rm kaczmarj/neurodocker:0.4.0 generate singularity \
--base debian:stretch --pkg-manager apt \
--fsl version=5.0.10 \
--miniconda create_env=neuro \
conda_install="python=3.6 traits" \
pip_install="nipype" > Singularity
$ singularity build my_nipype.simg Singularity


Use NeuroDebian
---------------

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

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


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

See the `Neurodocker examples page <https://github.com/kaczmarj/neurodocker/tree/master/examples/>`_ for more.

.. include:: ../links_names.txt