What Is Apptainer?

What is Apptainer, and how is it different from Docker? Apptainer is the free and open-source successor to the Singularity platform. Singularity still exists, which is why you will still hear that name. There are at present two different ways of getting the Singularity platform: Singularity Pro, which you need to pay for, and Singularity CE (the community edition), which is free. Fortunately, due to their common origin, Apptainer and Singularity generally interoperate with one another.

Apptainer has gotten more focus recently because it has been widely adopted by high performance computing (HPC) centers as the preferred way to use containers. One of the main reasons is that Apptainer (as well as Singularity) does not need to run its containers as the root user on the host system. In contrast, Docker requires you to become the root user in order to start containers. On an HPC system, it's not possible to have dozens of users each with root privilege. So the HPC users must run containers as regular users, and that is where Apptainer meets the needs of HPC centers better than Docker would.

Apptainer has other advantages as well. It can not only run Apptainer or Singularity container images that have been published, but it can also run Docker containers. It does this by converting them into Singularity Image Format (SIF). There has been another container image format from the Open Container Initiative, called OCI images, which will run within Apptainer as well.

Apptainer vs Docker

Here is a table of the differences between Docker and Apptainer. Docker containers came along first and are general purpose. They are used heavily in the commercial world for delivering web applications, for example. Apptainer's main focus is on high performance computing. As mentioned, you need to be the root user to use Docker, but not Apptainer, where you can just be a regular user. Docker can run OCI images but cannot run Apptainer/Singularity images, so Apptainer has an advantage there. Over time, these platforms have naturally been integrated with other software. On the Apptainer side, as you might expect in high performance computing environments, integrations are available with resource schedulers like Slurm, PBS, and LSF, making it easier to run containers through those services. On the Docker side, software like Kubernetes and Docker Swarm allows you to coordinate the running of multiple containers at once.

Apptainer vs Docker
Feature / Aspect
Use Case High Performance Computing General purpose
User Privileges Run containers as regular users Run containers as root
Image Formats SIF, Docker, OCI Docker/OCI Images
Integrations SLURM, PBS, LSF schedulers Kubernetes, Docker Swarm
Portability SIF files are easy to share Share through DockerHub

With Docker, the only way to easily get an image to run as a container is by downloading it from a registry. For Apptainer, you can do that as well, but it is also possible to take the single SIF file and hand it to someone, and they would have that container. It is all encapsulated in a single file.

 
©  |   Cornell University    |   Center for Advanced Computing    |   Copyright Statement    |   Access Statement
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)