When I run singularity exec foo.simg whoami
I get my own username from the host, unlike in Docker where I would get root
or the user specified by the container.
If I look at /etc/passwd
inside this Singularity container, an entry has been added to /etc/passwd
for my host user ID.
How can I make a portable Singularity container if I don't know the user ID that programs will be run as?
I have converted a Docker container to a Singularity image, but it expects to run as a particular user ID it defines, and several directories have been chown
'd to that user. When I run it under Singularity, my host user does not have access to those directories.
It would be a hack but I could modify the image to chmod 777
all of those directories. Is there a better way to make this image work on Singularity as any user?
(I'm running Singularity 2.5.2.)