Apptainer is package to run containers, similar to docker, and is the successor to Singularity. Using a container allows you to to package a set of applications into a single instance. The instance may be based on any Linux distribution and so allows access to programs that cannot run natively on OEL8. It can also be used to install specific versions of an operating system and/or applications so a consistent environment can be maintained.

Docker is not supported on the FRCE cluster for a variety of reasons. However, Apptainer can usually run Docker containers and a Docker definition can be modified to build a native Apptainer container with minimal effort.

Documentation

SyLabs Documentation
Tutorials produced by Sylabs
Apptainer/Singularity documentation on Biowulf
Tutorial given by Biowulf staff

Interactive use

A container can be designed to run a specific application automatically. The user can still interact with the application if needed and the application can be passed parameters such as input and output files. In this way, running the container is indistinguishable from running a native application. A container may also be run interactively, where a shell prompt is displayed. This is similar to a case where the user is connecting to a system running a different OS and with different applications installed.

$ module load apptainer
[+] Loading apptainer 1.4.0
$ apptainer pull docker://ghcr.io/apptainer/lolcow
INFO:    Converting OCI blobs to SIF format
INFO:    Starting build...
INFO:    Fetching OCI image...
27.2MiB / 27.2MiB [======================================] 100 % 28.1 MiB/s 0s
45.8MiB / 45.8MiB [======================================] 100 % 28.1 MiB/s 0s
INFO:    Extracting OCI image...
INFO:    Inserting Apptainer configuration...
INFO:    Creating SIF file...
INFO:    To see mksquashfs output with progress bar enable verbose logging
$ apptainer exec lolcow_latest.sif cowsay moo
< moo >
 -----
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

Alternatively, this can be done in one step.

$ module load apptainer
[+] Loading apptainer 1.4.0
$ apptainer run docker://sylabsio/lolcow:latest
INFO:    Converting OCI blobs to SIF format
WARNING: 'nodev' mount option set on /tmp, it could be a source of failure during build process
INFO:    Starting build...
INFO:    Fetching OCI image...
45.8MiB / 45.8MiB [======================================] 100 % 0.0 b/s 0s
27.2MiB / 27.2MiB [======================================] 100 % 0.0 b/s 0s
INFO:    Extracting OCI image...
INFO:    Inserting Apptainer configuration...
INFO:    Creating SIF file...
INFO:    To see mksquashfs output with progress bar enable verbose logging
 ______________________________
< Thu Jan 30 09:56:32 EST 2025 >
 ------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

Build instructions for those who are curious

$ cd ${ANNOVAR_DATA}
$ git clone https://github.com/apptainer/apptainer.git
$ cd apptainer
$ ./mconfig --prefix=/mnt/nasapps/production/apptainer/1.4.0
$ cd builddir && make && make install
$ git clone https://github.com/rfjakob/gocryptfs.git
$ cd gocrytpfs
$ ./build-without-openssl.bash
$ cp gocryptfs /mnt/nasapps/production/apptainer/1.4.0/bin/