Skip to content

Commit 4d1ab4b

Browse files
authored
Enhance Apptainer tutorial with overlay and fakeroot info
Added information about writable overlays and using fakeroot in Apptainer tutorial.
1 parent 175cc9c commit 4d1ab4b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

docs/hpc/07_containers/02_apptainer_tutorial.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ python_3.10.sif
3333
```
3434

3535
## Step 2: Run the Container
36+
:::info
37+
Apptainer images are immutable by default. You can mount an writable overlay file and edit files within the overlay.
38+
:::
3639

3740
Every container image has a default command defined by its creator. You can run it with:
3841

@@ -66,6 +69,14 @@ Hello from container
6669

6770
The command ran inside the containerized environment, then returned control to your shell.
6871

72+
### Using `fakeroot`
73+
74+
In some cases, you may need elevated permissions inside the container to install software or modify system files. Apptainer provides a `--fakeroot` option that allows you to run commands inside the container with root-like privileges, without requiring actual root access on the system.
75+
76+
```sh
77+
$ apptainer exec --fakeroot <image name>.sif <commands>
78+
```
79+
6980
## Step 4: Run a Simple Scientific Example
7081

7182
Containers are commonly used in research workflows to run code in a reproducible environment. For example, you can run a NumPy computation without installing NumPy locally:

0 commit comments

Comments
 (0)