From 46f45f2362aafdeed76da2f16d8ba66e8634adae Mon Sep 17 00:00:00 2001
From: David Carreto Fidalgo <david.carreto.fidalgo@mpcdf.mpg.de>
Date: Tue, 18 Mar 2025 10:28:03 +0000
Subject: [PATCH] add patching containers section

---
 README.md | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/README.md b/README.md
index 1abc71e..1b60440 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.
-- 
GitLab