Important Information

Mounting External Directories

Singularity is setup in our cluster so that it will automatically mount for you the directories /opt (which contains optional applications), /shared (which contains your home directory, and other shared directories) and /scratch (which contains /scratch for your scratch files). However these directories must already exist in your container! So ensure they are created by including the following commands within the %setup section of your container definition file:

    mkdir -p ${SINGULARITY_ROOTFS}/opt
    mkdir -p ${SINGULARITY_ROOTFS}/scratch
    mkdir -p ${SINGULARITY_ROOTFS}/shared

In the Singularity documentation this is covered under the section on Bind Paths

Best Practices for Build Recipes

  • Always include a %help section.
  • Build containers from a recipe instead of a sandbox that has been manually changed. This ensures better reproducibility and your less likely to end up with a “black box” container.
  • Install packages, programs, data, and files into operating system locations and not
    /home, /tmp, or other directories that might be “binded” over.
  • Files should never be owned by actual users, they should always be owned by a system account.
  • Make your container modular by using apps. Shared dependencies (between apps) can go under %post.


Do you need administrator privileges to use Singularity?

If you already have a container (whether Singularity or Docker) ready to go, you can use the run, shell, and import commands without root access. If you want to build a new Singularity container image from scratch it must be built and configured on a host where you have root access. This can be a physical system or a system running on a virtual machine. And of course once you have built that container image it can be used on a system where you do not have root access as long as Singularity has been installed there.

Can Singularity support daemon processes?

If you start a process daemon, it will exist on your host’s network. This means you can run a web server, or any other daemon, from within a container and access it directly from your host.

This is custom footer