Installing SPM12 (dockerised)

Prerequisities:

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create your website at WordPress.com
Get started
%d bloggers like this: