Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why does the apptainer seem to have access to my home directory

I run this command

apptainer exec myfile.sif ls -la /app

and it will correctly show all the files in the container. However, I try

apptainer exec myfile.sif ls -la ~

and it will show all the files in my home directory.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I’m confused. Why is that? Does the apptainer exec command automatically bind my home directory to the container?

>Solution :

Yes some directories, including $HOME are mounted automatically. See the documentation:

In the default configuration, the default bind mounts are:

  • The user’s home directory ($HOME)
  • The current working directory (CWD), unless its path contains symlinks resolving to different locations on the host vs inside the
    container.
  • /dev
  • /etc/hosts
  • /etc/localtime
  • /proc
  • /sys
  • /tmp
  • /var/tmp
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading