Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apptainer: use shell instead of bash #129

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bih-cluster/docs/how-to/software/apptainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The following guide gives a quick dive into using docker images with apptainer.
Run a bash in a docker image:

```bash
host:~$ apptainer bash docker://godlovedc/lolcow
host:~$ apptainer shell docker://godlovedc/lolcow
```

Run a command in a docker image:
Expand All @@ -51,7 +51,7 @@ host:~$ apptainer exec docker://godlovedc/lolcow echo "hello, hello!"
Run a bash in a docker image, enable access to the cuda driver (--nv) and mount a path (--bind or -B):

```bash
host:~$ apptainer bash --nv --bind /path_on_host/:/path_inside_container/ docker://godlovedc/lolcow
host:~$ apptainer shell --nv --bind /path_on_host/:/path_inside_container/ docker://godlovedc/lolcow
```

## Some Caveats and Notes
Expand All @@ -65,7 +65,7 @@ host:~$ apptainer bash --nv --bind /path_on_host/:/path_inside_container/ docker

- Environment variables can be provided by setting them in the bash and adding the prefix `APPTAINERENV_`:
```bash
host:~$ APPTAINERENV_HELLO=123 apptainer bash docker://godlovedc/lolcow echo $HELLO
host:~$ APPTAINERENV_HELLO=123 apptainer shell docker://godlovedc/lolcow echo $HELLO
```
- Calling `apptainer shell` or `apptainer exec` uses as cwd the host callers cwd not the one set in the Dockerfile.
One can change this by setting `--pwd`.
Expand All @@ -84,7 +84,7 @@ host:~$ apptainer run docker://godlovedc/lolcow
or to open a shell inside the image

```bash
host:~$ apptainer bash docker://godlovedc/lolcow
host:~$ apptainer shell docker://godlovedc/lolcow
```

Furthermore, similar to docker, one can pull (and convert) remote image with the following call:
Expand Down