Skip to content

Instantly share code, notes, and snippets.

@pierlauro
Last active April 9, 2016 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pierlauro/3fd828cd3a95625aeb42f58f8ea54c0b to your computer and use it in GitHub Desktop.
Save pierlauro/3fd828cd3a95625aeb42f58f8ea54c0b to your computer and use it in GitHub Desktop.
SFDM docker container

================================================================== Docker container - serial functional Diffusion Mapping (sfDM)

Instructions to build a sfDM image and use it by tunnelling the GUI.

After the installation, local filesystem will be mounted (R/W) in /home_host in the container

==================================================================

  • (1) Save the following docker build file:

Dockerfile

FROM ubuntu:14.04

# Install system dependencies
RUN apt-get update && apt-get install -y dialog wget python-pip libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk
RUN pip install ipython

# Add neurodebian sources
RUN wget -O- http://neuro.debian.net/lists/trusty.au.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
RUN wget -O- http://neuro.debian.net/lists/trusty.de-m.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
RUN apt-key adv --recv-keys --keyserver hkp://pgp.mit.edu:80 0xA5D32F012649A5A9

RUN apt-get update

# Install application dependencies
RUN apt-get install -y afni fsl-complete python-nipy python-nipype

# Install sfDM
RUN pip install sfDM

# Configure X11 forwarding
RUN export uid=1000 gid=1000 && \
	mkdir -p /home/developer && \
	echo "developer:x:${uid}:${gid}:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \
	echo "developer:x:${uid}:" >> /etc/group && \
	echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \
	chmod 0440 /etc/sudoers.d/developer && \
	chown ${uid}:${gid} -R /home/developer

USER developer
ENV HOME /home/developer
CMD /usr/local/bin/sfDM_gui
  • (2) Build image
docker build -t sfdm .
  • (3) Run container by tunnelling GUI
docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v /home:/home_host sfdm

If it doesn't work, enable X11 tunnelling:

xhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment