@@ -231,9 +231,13 @@ The semantics here are somewhat nuanced:
231231- Changes persist across reboots by default
232232- During updates, new files from the container image override any locally modified version
233233
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".
234+ The advantages are:
235+ - It makes it very easy to make compatible applications that install into ` /opt ` .
236+ - In contrast to transient root (above), a smaller surface of the filesystem is mutable.
237+
238+ The disadvantages are:
239+ - There is no equivalent to this feature in the Docker/Podman ecosystem.
240+ - It allows for some temporary state drift until the next update.
237241
238242To enable this feature, instantiate the
` [email protected] ` 239243unit template on the target path. For example, for ` /opt ` :
@@ -242,8 +246,10 @@ unit template on the target path. For example, for `/opt`:
242246RUN systemctl enable [email protected] 243247```
244248
245- ### Alternatives to state overlays
249+ ## More generally dealing with ` /opt `
246250
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.
251+ Both transient root and state overlays above provide ways for packages
252+ that install in ` /opt ` to operate. However, for maximum immutability the
253+ best approach is simply to symlink just the parts of the ` /opt ` needed
254+ into ` /var ` . See the section on ` /opt ` in [ Image building and configuration
255+ guidance] ( building/guidance.md ) for a more concrete example.
0 commit comments