Intermediate build checkpoints for singularity containers?

22 Views Asked by At

I have to build a container with singularity/apptainer. However, I'm in the process of writting the definition file, which needs some iteration and building the image is pretty long;

I'm pretty new to singularity/apptainer. However, I remember docker was "clever" enough to rebuild only necessary steps once a Dockerfile was changed.

I just cannot find such an option with singularity ; It means that, for now, everytime I append new code at the end of my build process, singularity rebuilds the whole image.

Do you know if there is some possiblity for checkpointing intermediate builds with singularity/apptainer ?

Thanks for your help

I went through the doc , tried googling but did not find anything on iterative build , or checkpointing the build.

1

There are 1 best solutions below

0
tsnowlan On

Singularity doesn't offer the same type of build step caching that docker does. Depending on your use case, it may be simplest to create the image with a Dockerfile and then simply build the singularity image from the generated Docker image. This way you can take advantage of Docker's build caching and have identical images available for both container technologies.

Alternatively, you can create an initial image as a sandbox, make changes and adjustments as you go, and create a final read-only image from the end result. This can be helpful during initial creating a new image, but with the limitation of not having a concrete definition file to build new images from.