Apptainer
Apptainer, formerly known as Singularity, is a container platform used on HPC
systems. It allows users to run software inside portable .sif container
images without Docker or sudo access.
Warning
Apptainer is not a separate login system. Users log in to the cluster, load the Apptainer module, and then run containers.
While Docker is a widely used container runtime, HPC clusters commonly use Singularity or Apptainer. Here is a quick comparison:
S.NO |
Docker |
Apptainer |
|---|---|---|
1 |
Infrastructure/application deployment |
Scientific computing/HPC |
2 |
System service |
User application |
3 |
Often needs elevated permissions |
No extra user privileges |
4 |
Docker-managed image layers |
One portable |
Apptainer is useful on HPC systems because it allows users to:
Run software with specific dependencies.
Package workflows into portable
.sifimages.Reproduce environments across systems.
Run containers without Docker or sudo access.
Use HPC resources such as scratch storage, GPUs, and LSF jobs when configured.
A typical workflow is:
Log in to the cluster.
Load the Apptainer module.
Download or build a container image.
Test the container with
shell,exec, orrun.Submit real workloads through LSF.
Start with the first six pages for the normal beginner workflow. Use the troubleshooting and examples pages when testing your own containers. The advanced section contains older specialized examples that are still useful, but are not part of the basic workflow.
Getting Help
If you are not sure which Apptainer workflow is appropriate for your project, contact the IDSC support team before running GPU jobs, Jupyter/RStudio servers, long-running container jobs, or specialized workflows.
Some requests, such as fakeroot access, GPU/project access, or containerized interactive applications, may require additional guidance or approval.
Submit an IDSC support ticket with a brief description of your project requirement: IDSC Support Ticket
Apptainer
- Quick Start
- Container Images and Builds
- Container Image Types
- SIF Images
- Image Cache
- Temporary Writable Containers
- Sandbox Directory
- Persistent Overlay
- Definition Files
- Common Definition File Sections
- Advanced Definition File Sections
- Example Definition File
- Build the Container
- Skip Build-Time Tests
- Test the Container
- Run the Container
- View Container Help
- Recommended Usage
- Inspecting and Verifying Images
- Working with Files and Bind Mounts
- Running Jobs with LSF
- GPU Containers
- Troubleshooting Common Issues
- Apptainer Command Not Found
- Image Is Read-Only
- Wrong Architecture
- File Not Found Inside Container
- Permission Denied for Host Files
- Output File Is Missing
- Fakeroot Not Available
- Package Installation Fails During Build
- Container Works Interactively but Fails in LSF
- GPU Not Visible Inside Container
- TensorFlow Shows an Empty GPU List
- PyTorch Reports CUDA Is Not Available
- Environment Conflicts
- Cache Uses Too Much Space
- Remote Image Pull Fails
- Jupyter or RStudio Left Running
- When to Contact IDSC
- Practical Examples
- Example 1: Quick Container Check
- Example 2: Run a Python Script
- Example 3: Use Input and Output Directories
- Example 4: CPU Batch Job with LSF
- Example 5: Build a Small Container from a Definition File
- Example 6: GPU Container Check
- Example 7: More Isolated Run with Explicit Binds
- Example 8: Reuse Bind Mounts with
APPTAINER_BIND - Recommended Pattern
- Advanced Topics