Installing SPM12 (dockerised)


Obtain the Dockerfile:

curl -f -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.


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


Leave a Reply

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

You are commenting using your 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 with
Get started
%d bloggers like this: