What is the equivalent of docker commit in singularity?

Viewed 481

Is there an equivalent to docker commit in Singularity?

(note: docker commit enables to create a new image from a container’s changes)

1 Answers

The closest equivalent is to create a sandbox image with sudo singularity build --sandbox ..., enter it with sudo singularity shell --writable sandbox/, and make your changes there.

When you run a sandbox in writable mode, all changes you make are saved to the image/directory. Once you are happy with them, you can then create a (much smaller) read only image from the sandbox for production use.

It is important to note that in this case, you need to use sudo when modifying the container. More info on sandboxes and --writable are in the documentation, including how to create a new image from an existing one.

Related