Apptainer (formerly known as Singularity) is an operating-system-level virtualization tool also known as containerization. In contrast to, e.g., Docker, it is developed with shared scientific computing environments in mind.

Apptainer is provided on our HPC systems. Even building Apptainer containers on the systems themselves should work since recently thanks to user namespaces instead of suid binaries.

Most filesystems will be available by default in the container. Therefore, in certain use cases it might be a good idea to avoid bind-mounting your normal $HOME directory with all its “dot directories” into the container by explicitly specifying a different directory, e.g. -H $HOME/my-container-home.

When importing containers e.g. from dockerhub set the environment variable APPTAINER_CACHEDIR to save space in $HOME as it defaults to ~/.apptainer/cache/.

The usage of MPI inside the container is not recommended as it requires the exact versions of the MPI implementation and its dependencies (e.g. Slurm and Infiniband libraries).

Our colleagues from GWDG put together a nice intro to Singularity – we link it here although many details will not work 1:1 on our system:

More information about the general usage of Singularity available in this HPC Cafe presentation.