I am trying to build a writable singularity container with the command sudo singularity build --writable my_container.img docker://image_name, but I get the error Error for command "build": unknown flag: --writable.
I decided to follow a guide from Singularity (here) to see if I could find my problem. I am using the command sudo singularity build --writable lolcow.img shub://GodloveD/lolcow, but I am getting the same error Error for command "build": unknown flag: --writable.
I am on singularity version 3.6.4.
Does anyone happen to know what might be going on?
--writable is option for running. That is for building:
sudo singularity build lolcow.img shub://GodloveD/lolcow
For running:
singularity run --fakeroot --writable lolcow.img
You also need --fakeroot to write in root accessible places.
However, It is not persistent. As reminded by "Converting SIF file to temporary sandbox..." message. That is you can write during your session but after you done it is gone:
$ 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>
For persistent writes for testing/developing purpose you can use --sandbox option, though you'll need to run it as root too:
$ 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With