Skip to content

Commit 877c339

Browse files
committed
docs/filesystem: Weaken stateoverlay wording and direct to alternatives
We wrote the code and it is useful. We are probably just going to need to support it into the forseeable future. However, my core problem with it is what I wrote in the docs here: it has no equivalent in the docker/podman ecosystem, which I think cuts against a core principle that we're trying to make the booted host align with containers. Of course, stateoverlay isn't a lot of code, and in theory it's a bit independent of ostree, so perhaps we could try to split it out at some point and then it could be used by e.g. `podman run --mount=type=stateoverlay` or so. Before anyone starts just blindly enabling stateoverlays I'd like them to have considered alternatives such as the symlink approach. Signed-off-by: Colin Walters <[email protected]>
1 parent 8e2cf08 commit 877c339

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

docs/src/filesystem.md

Lines changed: 16 additions & 3 deletions
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 `[email protected]`
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 `[email protected]`
232239
unit template on the target path. For example, for `/opt`:
233240

234241
```
235242
RUN systemctl enable [email protected]
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)