I have build a singularity container and uploaded it to my HPC service.
Is there a way to change the runscript of the .sif file without rebuilding the whole container? I have a shell on the service.
From my understanding of singularity this should be possible but I cant find out how.
You could create a new sif, based on the old sif and add the new runscript.
Bootstrap: localimage
From: my-old.sif
You can convert a SIF file to a (writable) sandbox which is indeed a directory:
sudo singularity build --sandbox <SANDBOX> <CONTAINER>.sif
Then you can "get into" the sandbox and modify things there (note the --writable
flag and the need for sudo
):
sudo singularity shell --writable <SANDBOX>
Or you can edit <SANDBOX>/singularity
or <SANDBOX>/environment
as suggested by Quentin.
Additional goodies can be found in the <SANDBOX>/.singularity.d
directory. Such as the Singularity
file which is the recipe the container was built from.
Once you are happy with the changes you can convert the sandbox back to a (new) SIF file:
sudo singularity build <NEW_CONTAINER>.sif <SANDBOX>
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