Search code examples
dockerhpcsingularity-container

--no-home Singularity flag doesn't work on Docker container in a cluster node


When I use a Docker container on a HPC cluster's login machine using Singularity, it works as expected and I can access the container's /home:

singularity exec docker://quay.io/comparative-genomics-toolkit/cactus:v2.7.1 ls /home

When I run the same command on the computing node, I have access to the node's /home instead of the container's one:

srun singularity exec docker://quay.io/comparative-genomics-toolkit/cactus:v2.7.1 ls /home

I tried with --no-home, --contain and --containall, it makes no difference.

Both machines have the same version of Singularity and the same singularity.conf file.

How can I get the container's /home on the cluster's node?


Solution

  • The --no-mount hostfs option was the only one that worked to prevent /home from being mounted. the problem is that it prevents everything from being mounted, so I had to manually bind the folders I needed.

    So the working command is

    singularity exec --no-mount hostfs --bind $PWD:$PWD docker://quay.io/comparative-genomics-toolkit/cactus:v2.7.1 ls /home
    

    Maybe it is worth to note that my $HOME folder wasn't in /home. It could explain why --no-home had no effect. But it still doesn't explain why there is a difference between the login machine and the node machine.