Prerequisities:
- Is Docker installed? If not: https://5k45h.wordpress.com/2020/03/16/installing-docker/
Obtain the Dockerfile:
curl -f https://raw.githubusercontent.com/spm/spm-docker/master/matlab/Dockerfile -o Dockerfile
Build the Dockerfile:
docker build -t spm12 .
To use SPM12 GUI, first open the xhost to docker:
xhost +local:docker
Call spm fmri as you would but with docker arguments:
docker run -ti --rm -e DISPLAY=$DISPLAY -v $PWD:/data -v /tmp:/tmp -v /tmp/.X11-unix:/tmp/.X11-unix spm12 fmri
The mount-point -v $PWD:/data can be used to mount the $PWD as /data inside docker.
OR
get it directly from Docker Hub:
docker pull spmcentral/spm
Too long? Create a bash alias ¯\_(ツ)_/¯
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
Open a new terminal. Now you can call the dockerised SPM12 GUI using spm_gui
Reference: https://en.wikibooks.org/wiki/SPM/Docker, http://wiki.ros.org/docker/Tutorials/GUI, https://dzone.com/articles/docker-x11-client-via-ssh