Skip to content

Commit 910705a

Browse files
committed
updating usage docs to include --home
1 parent b35b294 commit 910705a

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

pages/docs/overview/faq.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,36 @@ $ sudo sysctl -w kernel.grsecurity.chroot_deny_chmod=0
256256
$ sudo sysctl -w kernel.grsecurity.chroot_deny_fchdir=0
257257
```
258258

259+
### The container isn't working on a different host!
260+
Singularity by default mounts your home directory. While this is great for seamless communication between your host and the container, it can introduce issues if you have software modules installed at `$HOME`. For example, we had a user <a href="https://github.com/singularityware/singularity/issues/476" target="_blank">run into this issue</a>.
261+
262+
263+
#### Solution 1: Specify the home to mount
264+
A first thing to try is to point to some "sanitized home," which is the purpose of the `-H` or `--home` option. For example, here we are creating a home directory under `/tmp/homie`, and then telling the container to mount it as home:
265+
266+
```bash
267+
rm -fr /tmp/homie
268+
mkdir -p /tmp/homie
269+
singularity exec -H /tmp/homie analysis.img /bin/bash
270+
```
271+
272+
#### Solution 2: Specify the executable to use
273+
It may be the issue that there is an executable in your host environment (eg, python) that is being called in preference to the containers. To avoid this, in your runscript (the `%runscript` section of the bootstrap file) you should specify the path to the executable exactly. This means:
274+
275+
276+
```bash
277+
%runscript
278+
279+
# This specifies the python in the container
280+
exec /usr/bin/python "$@"
281+
282+
# This may pick up a different one
283+
exec /usr/bin/python "$@"
284+
```
285+
286+
This same idea would be useful if you are issuing the command to the container using `exec`. Thanks to <a href="https://github.com/yarikoptic" target="_blank">yarikoptic</a> for the suggestions on this issue.
287+
288+
259289
### Error running Singularity with sudo
260290

261291
This fix solves the following error when Singularity is installed into the default compiled prefix of /usr/local:

pages/docs/user-docs/docs-usage.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ CONTAINER USAGE COMMANDS:
3737
shell Run a Bourne shell within container
3838
test Execute any test code defined within container
3939

40+
CONTAINER USAGE OPTIONS:
41+
-H --home Specify $HOME to mount
42+
4043
CONTAINER MANAGEMENT COMMANDS (requires root):
4144
bootstrap Bootstrap a new Singularity image from scratch
4245
copy Copy files from your host into the container
@@ -46,6 +49,10 @@ CONTAINER MANAGEMENT COMMANDS (requires root):
4649
import Import/add container contents via a tar pipe
4750
mount Mount a Singularity container image
4851

52+
CONTAINER REGISTRY COMMANDS:
53+
pull pull a Singularity Hub container to $PWD
54+
55+
4956
For any additional help or support visit the Singularity
5057
website: http://singularity.lbl.gov/
5158
```

0 commit comments

Comments
 (0)