diff --git a/README.md b/README.md index 1abc71ea2c6fc64d0d67f2731cb7220b543966d0..1b60440aa0ce347d8ec5dfffd66b90f829d40839 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,28 @@ $ apptainer build my_apptainer.sif docker-archive:lolcow.tar - mention important flags, like `--nv` for example - how to run the containers on our SLURM cluster +## Patching containers + +If you want to permanently modify files in your container, you can use persistent "overlays". These are writable file system images that sit on top of your immutable SIF container. + +Here, we provide a quick overview of how to use overlays. Please look at the dedicated section of the official [apptainer documentation](https://apptainer.org/docs/user/main/persistent_overlays.html) for more details about using overlays or making your SIF container writable and persisting changes. + +- **Create an overlay** + +```shell +$ apptainer overlay create --size 1024 ./overlay.img +``` + +- **Apply an overlay** + +```shell +$ apptainer shell --overlay overlay.img my_container.sif +``` + +Now you can modify files inside the container and the modifications will be stored in the `overlay.img` file. + +You can apply overlays with the `run`, `exec`, `shell` and `instance start` commands. + ## Using containers with RVS The [Remote Visualisation Service (RVS)](https://docs.mpcdf.mpg.de/doc/visualization/index.html) allows you to run Jupyter sessions on the HPC systems.