Apptainer
Current Status
- Installed Version: 1.4.2 (latest as of December 2024)
- Installation Method: Direct .deb package installation
Installation Methods for Ubuntu 24.04
Why No APT Repository?
As of December 2024, Apptainer does not provide an official APT repository for Ubuntu. This is different from the old Singularity days when there was a Sylabs PPA. The official installation methods are:
- Direct .deb Download (Recommended)
- Build from Source
- Install via Conda/Mamba
Method 1: Direct .deb Installation (Recommended)
Use the provided script:
sudo ./install-apptainer.shThis script:
- Downloads the latest release from GitHub
- Installs dependencies
- Optionally installs SUID helper for unprivileged users
- Sets up environment variables
Method 2: Build from Source
For those who need custom builds:
# Install dependencies
sudo apt update
sudo apt install -y build-essential libseccomp-dev pkg-config \
uidmap squashfs-tools squashfuse fuse2fs fuse-overlayfs \
fakeroot cryptsetup curl wget git
# Get source
export VERSION=1.4.2
wget https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer-${VERSION}.tar.gz
tar -xzf apptainer-${VERSION}.tar.gz
cd apptainer-${VERSION}
# Configure and build
./mconfig
make -C builddir
sudo make -C builddir installMethod 3: Via Conda/Mamba
For user-space installation:
conda install -c conda-forge apptainer
# or
mamba install -c conda-forge apptainerVersion History
The package you have installed (1.4.2-1~jammy) indicates it was likely installed:
- From a previous Ubuntu 22.04 installation that was upgraded
- From a manual .deb download
- From a now-removed repository
Key Differences from Singularity
Apptainer is the continuation of Singularity after it joined the Linux Foundation:
- Singularity CE → Apptainer (open source, Linux Foundation)
- Singularity Pro → SingularityPRO (commercial, Sylabs)
SUID vs Non-SUID
- With SUID: Unprivileged users can build and run containers using kernel features
- Without SUID: Only root can use certain features; regular users limited to pre-built containers
To check SUID status:
ls -la /usr/libexec/apptainer/bin/starter-suidEnvironment Variables
Key variables to configure:
# Cache directory for images
export APPTAINER_CACHEDIR=/var/cache/apptainer
# Temporary directory for builds
export APPTAINER_TMPDIR=/tmp
# Bind paths (directories accessible in containers)
export APPTAINER_BINDPATH=/data,/scratchCommon Commands
# Pull from Docker Hub
apptainer pull docker://ubuntu:22.04
# Pull from Singularity Hub
apptainer pull shub://vsoch/hello-world
# Build from definition file
sudo apptainer build container.sif definition.def
# Run container
apptainer run container.sif
# Shell into container
apptainer shell container.sif
# Execute command
apptainer exec container.sif python script.py
# Inspect container
apptainer inspect container.sifTroubleshooting
Cache Issues
# Clear cache
apptainer cache clean
# List cache
apptainer cache listPermission Issues
- Ensure SUID is installed for unprivileged builds
- Check bind paths are accessible
- Verify cache directory permissions
Network Issues in Containers
Add --net flag:
apptainer shell --net container.sifMigration from Singularity
Apptainer is fully compatible with Singularity containers:
.siffiles work without modification- Definition files (
.def) are compatible - Commands are nearly identical (replace
singularitywithapptainer)
Resources
- Official Docs: https://apptainer.org/docs/user/latest/
- GitHub: https://github.com/apptainer/apptainer
- Definition File Guide: https://apptainer.org/docs/user/latest/definition_files.html
- Docker to Apptainer: https://apptainer.org/docs/user/latest/docker_and_oci.html