You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/hpc/15_tutorial_apptainer/03_apptainer_files.mdx
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,27 +21,27 @@ Files created in these mounted directories remain available after the container
21
21
22
22
## Binding Additional Directories
23
23
24
-
Sometimes you may need access to additional directories that are not automatically available inside the container.
24
+
Sometimes you may need access to directories through a different path inside the container.
25
25
26
26
Apptainer allows additional directories to be mounted using the `-B` option:
27
27
28
28
```bash
29
29
apptainer shell \
30
-
-B /scratch:/scratch \
30
+
-B /scratch/(NetID):/data \
31
31
/share/apps/images/ubuntu-24.04.3.sif
32
32
```
33
33
34
-
This makes `/scratch`available inside the container.
34
+
In this example, your scratch directory on the host system is made available as `/data` inside the container.
35
35
36
-
You can also mount a directory at a different location:
36
+
After entering the container, you can verify the mount:
37
37
38
38
```bash
39
-
apptainer shell \
40
-
-B /scratch:/data \
41
-
/share/apps/images/ubuntu-24.04.3.sif
39
+
ls /data
42
40
```
43
41
44
-
In this example, files stored in `/scratch` on the host system are accessible through `/data` inside the container.
42
+
Any files stored in `/scratch <NetID>` on the host system will be accessible through `/data` inside the container.
43
+
44
+
The source and destination paths do not need to be the same. This can be useful when an application expects data to be located in a specific directory within the container.
0 commit comments