Skip to content

Installing SPM12 (dockerised)

Sriranga Kashyap edited this page Oct 29, 2020 · 1 revision

Prerequisities

Docker

Method-1: Get it from Docker Hub

docker pull spmcentral/spm

Method-2: DIY

  1. Obtain the Dockerfile curl -f https://raw.githubusercontent.com/spm/spm-docker/master/matlab/Dockerfile -o Dockerfile

  2. Build it docker build -t spm12 .

Using SPM12 GUI:

  1. Open the xhost to docker xhost +local:docker

  2. To call spm fmri from docker docker run -ti --rm -e DISPLAY=$DISPLAY -v $PWD:/data -v /tmp:/tmp -v /tmp/.X11-unix:/tmp/.X11-unix spm12 fmri

Too long?

  1. Create a bash alias called spm_gui 😏

  2. Add to bash profile echo 'alias spm_gui="docker run -ti --rm -e DISPLAY=$DISPLAY -v /$PWD:/data -v /tmp:/tmp -v /tmp/.X11-unix:/tmp/.X11-unix spm12 fmri"' >> ~/.bashrc

  3. Open a new terminal and run spm_gui 🤓