Skip to content

Instantly share code, notes, and snippets.

@prehensilecode
Last active February 18, 2025 19:33
Show Gist options
  • Save prehensilecode/9bc123b601254478c8e513be20da495c to your computer and use it in GitHub Desktop.
Save prehensilecode/9bc123b601254478c8e513be20da495c to your computer and use it in GitHub Desktop.
Apptainer def file for FSL
Bootstrap: debootstrap
OSversion: focal
MirrorURL: https://us.archive.ubuntu.com/ubuntu/
%environment
export FSLDIR="/usr/local/fsl"
export DEBIAN_FRONTEND="noninteractive"
export LANG="en_US.UTF-8"
%post
apt update -y && \
apt upgrade -y && \
apt install -y \
python3 \
wget \
file \
dc \
pulseaudio \
libquadmath0 \
libgtk2.0-0 \
firefox \
libgl1 \
libgomp1 && \
wget https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py && \
python3 ./fslinstaller.py -d /usr/local/fsl/
%startscript
sh -c . /usr/local/fsl/etc/fslconf/fsl.sh && /bin/bash
%runscript
sh -c . /usr/local/fsl/etc/fslconf/fsl.sh && exec echo "$@"
@prehensilecode
Copy link
Author

Notes on using the container

To run an application:

apptainer exec --nv fsl.sif /usr/local/fsl/bin/fsleyes

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