无法构建可写奇点容器

Unable to build writable singularity container

我正在尝试使用命令 sudo singularity build --writable my_container.img docker://image_name 构建可写奇点容器,但我收到错误 Error for command "build": unknown flag: --writable

我决定遵循 Singularity (here) 的指南,看看是否能找到我的问题。我正在使用命令 sudo singularity build --writable lolcow.img shub://GodloveD/lolcow,但出现相同的错误 Error for command "build": unknown flag: --writable

我使用的是奇点版本 3.6.4。

有没有人碰巧知道会发生什么?

--可写是 运行ning 的选项。那是为了建造:

sudo singularity build lolcow.img shub://GodloveD/lolcow

对于运行宁:

singularity run --fakeroot --writable lolcow.img

您还需要 --fakeroot 才能在 root 可访问的地方写入。

但是,它并不持久。正如“Converting SIF file to temporary sandbox...”消息所提醒的那样。也就是说,您可以在会话期间写入,但完成后它就消失了:

$ singularity shell -f --writable lolcow.img

INFO:    Converting SIF file to temporary sandbox...
WARNING: Skipping mount /etc/localtime [binds]: /etc/localtime doesn't exist in container
Singularity> echo test > /etc/banana
Singularity> cat /etc/banana
test
Singularity> exit
INFO:    Cleaning up image...

$ singularity shell -f --writable lolcow.img

INFO:    Converting SIF file to temporary sandbox...
WARNING: Skipping mount /etc/localtime [binds]: /etc/localtime doesn't exist in container
Singularity> cat /etc/banana
cat: /etc/banana: No such file or directory
Singularity>

为了 testing/developing 目的的持久写入,您可以使用 --sandbox 选项,尽管您也需要 运行 它作为根用户:

$ sudo singularity build --sandbox lolcow.img shub://GodloveD/lolcow

$ sudo singularity shell --writable lolcow.img

WARNING: Skipping mount /etc/localtime [binds]: /etc/localtime doesn't exist in container
Singularity> echo test > /etc/banana
Singularity> cat /etc/banana
test
Singularity> exit

$ sudo singularity shell --writable lolcow.img
WARNING: Skipping mount /etc/localtime [binds]: /etc/localtime doesn't exist in container
Singularity> cat /etc/banana
test
Singularity> exit