Skip to content

Commit 57adb67

Browse files
authoredMar 13, 2025··
Merge pull request #1191 from cgwalters/stateoverlay-discouragement
docs/filesystem: Weaken stateoverlay wording and direct to alternatives
2 parents 554c621 + 877c339 commit 57adb67

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed
 

‎docs/src/filesystem.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,25 @@ More on prepare-root: <https://ostreedev.github.io/ostree/man/ostree-prepare-roo
225225

226226
This feature enables a writable overlay on top of `/opt` (or really, any
227227
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.
230228

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`
232239
unit template on the target path. For example, for `/opt`:
233240

234241
```
235242
RUN systemctl enable ostree-state-overlay@opt.service
236243
```
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

Comments
 (0)
Please sign in to comment.