@@ -225,12 +225,25 @@ More on prepare-root: <https://ostreedev.github.io/ostree/man/ostree-prepare-roo
225
225
226
226
This feature enables a writable overlay on top of ` /opt ` (or really, any
227
227
toplevel or subdirectory baked into the image that is normally read-only).
228
- Changes persist across reboots but during updates, new files from the container
229
- image override any locally modified version. All other files persist.
230
228
231
- To enable this feature, simply instantiate the ` ostree-state-overlay@.service `
229
+ The semantics here are somewhat nuanced:
230
+
231
+ - Changes persist across reboots by default
232
+ - During updates, new files from the container image override any locally modified version
233
+
234
+ A disadvantage of this approach is that there is no equivalent to this feature in the
235
+ Docker/podman ecosystem, and while its semantics can often trivially enable many applications that
236
+ install into ` /opt ` , it can still be prone to "state drift".
237
+
238
+ To enable this feature, instantiate the ` ostree-state-overlay@.service `
232
239
unit template on the target path. For example, for ` /opt ` :
233
240
234
241
```
235
242
RUN systemctl enable ostree-state-overlay@opt.service
236
243
```
244
+
245
+ ### Alternatives to state overlays
246
+
247
+ See the section on ` /opt ` in [ Image building and configuration guidance] ( building/guidance.md ) .
248
+ Essentially, add a redirect such as a symbolic link from ` /opt/someapp/logs ` or other
249
+ directories that should be writable+persistent to ` /var/someapp/logs ` instead.
0 commit comments