docker commit in singularity 的等价物是什么?

What is the equivalent of docker commit in singularity?

有没有等同于docker commit in Singularity的东西?

(注意:docker commit 可以从容器的更改中创建新图像)

最接近的等效方法是使用 sudo singularity build --sandbox ... 创建一个沙盒图像,使用 sudo singularity shell --writable sandbox/ 输入它,然后在那里进行更改。

当您 运行 沙箱处于可写模式时,您所做的所有更改都会保存到 image/directory。一旦您对它们感到满意,您就可以从沙箱中创建一个(小得多的)只读图像以供生产使用。

需要注意的是,在这种情况下,修改容器时需要使用sudo。有关沙盒和 --writable 的更多信息是 in the documentation,包括如何从现有图像创建新图像。