This lesson is still being designed and assembled (Pre-Alpha version)

Introduction to Singularity/Apptainer

Apptainer (formerly known as Singularity) is a free and open-source container platform that allows you to create and run applications in isolated images (also called β€œcontainers”) in a simple, portable, fast, and secure manner. It performs operating system level virtualization known as containerization. Many container platforms are available, but Apptainer is designed to bring containers and reproducibility to the scientific community and High-Performance Computing (HPC) use cases. Using Apptainer, developers can work in reproducible environments of their choice and design, and these complete environments can be easily copied and executed on other platforms.

This is an introduction to Singularity/Apptainer, its motivations and applications in HEP.

Based on the Apptainer user guide.


  • Basic knowledge of the Unix Shell, e.g., from the carpentry course.
  • Access to a computing system with Apptainer/Singularity available. It can either be installed locally, or the machine can have user namespaces enabled and access to CVMFS.

HSF Software Training

HSF Logo
This training module is part of the HSF Software Training Center, a series of training modules that serves HEP newcomers the software skills needed as they enter the field, and in parallel, instill best practices for writing software.


Setup Download files required for the lesson
00:00 1. Introduction What issues motivated the creation of Apptainer/Singularity?
What are the differences between Docker, Singularity and Apptainer?
00:10 2. Containers and Images How to pull Singularity images from the libraries?
How to run commands inside the containers?
00:35 3. Coffee break! Get up, stretch out, and dance!
00:50 4. Building Containers How to build containers with my requirements?
02:00 5. Containers from definition files How to easily build and deploy containers from a single definition file?
03:10 6. Coffee break! Get up, stretch out, take a short break.
03:25 7. Sharing files between host and container How to read and write files on the host system from within the container?
04:05 8. Bonus Episode How to build singularity container for python packages?
How to share singularity images?
04:45 Finish

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.


The following people contributed to the content of this lesson: Note that this list does not include the contributors to the framework as developed by the carpentries.