This is a collaborative space. In order to contribute, send an email to maximilien.chaumon@icm-institute.org
On any page, type the letter L on your keyboard to add a "Label" to the page, which will make search easier.

How to update a Docker container

All Brainlife containers available are listed here: https://hub.docker.com/u/brainlife. It is possible to share the same Docker container across multiple Apps, but make sure to always specify the container version, so that you App won’t be affected when the container will be updated.

Example:

singularity exec docker://brainlife/mne:0.22.0 python3 maxfilter.py

As presented in the example above, we are currently developing Apps with MNE Python version 0.22.0, so we need the Brainlife/mne Docker container pointing to that version to avoid any compatibility problem.

Meeting with Giulia Berto

Jan 26, 2021

Giulia has updated the Brainlife/mne Docker container to MNE version 0.22.0 because before the latest stable version of MNE available was 0.19.2, which leads to some compatibility problems (arguments of some function are different from one version to another for instance).

She created a tutorial about Docker: GitHub - giulia-berto/docker-tutorial: Docker tutorial to build an FSL container. (here only the part 6 interests us).

To update an existing container, you first have to update the Dockerfile.

For instance for the Brainlife/mne container (https://github.com/brainlife/docker-mne ):

  • Previous Dockerfile (with MNE version 0.19.2)

FROM python:3.7.5 #RUN pip install --upgrade --no-deps git+https://github.com/mne-tools/mne-python.git RUN pip install mne matplotlib==0.19.2
  • Updated Dockerfile (with MNE version 0.22.0)

FROM python:3.7.5 #RUN pip install --upgrade --no-deps git+https://github.com/mne-tools/mne-python.git #RUN pip install mne matplotlib==0.19.2 RUN pip install --upgrade pip RUN pip install mne==0.22.0 matplotlib

It’s good practice to update pip too. It is possible to add other Python libraries (pandas, scikit-learn…), just add it after RUN pip install.

Once your Dockerfile is updated, you have to build the Docker container image locally (with a new tag) and push it to Docker Hub (you need to have a Docker Hub account). For instance:

Brainlife has its own Docker Hub, but it is possible for us to create our own Docker containers, push it to our own Docker Hub, and make our App running on Brainlife on this Docker container. Nevertheless, if we used a Docker hosted in the Brainlife Docker Hub, it will be maintained in the long term by Brainlife.