Skip to content

Commit 3949ffc

Browse files
committed
docs/filesystem: document state overlays
This works fine now and is another alternative to solving the `/opt` problem. Signed-off-by: Jonathan Lebon <[email protected]>
1 parent 94521ec commit 3949ffc

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

docs/src/filesystem.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,35 @@ a subdirectory of `/opt` such as `/opt/examplepkg`.
136136
See [building images](building/guidance.md) for recommendations on how to build
137137
container images and adjust the filesystem for cases like this.
138138

139+
However, for some use cases, it may be easier to allow some level of mutability.
140+
There are two options for this, each with separate trade-offs: transient roots
141+
and state overlays.
142+
139143
#### Enabling transient root
140144

141-
However, some use cases may find it easier to enable a fully transient writable rootfs by default.
145+
This feature enables a fully transient writable rootfs by default.
142146
To do this, set the
143147

144148
```toml
145149
[root]
146150
transient = true
147151
```
148152

149-
option in `prepare-root.conf`. In particular this will allow software to write (transiently) to `/opt`,
150-
with symlinks to `/var` for content that should persist.
153+
option in `prepare-root.conf`. In particular this will allow software to
154+
write (transiently, i.e. until the next reboot) to all top-level directories,
155+
including `/usr` and `/opt`, with symlinks to `/var` for content that should
156+
persist.
157+
158+
#### Enabling state overlays
159+
160+
This feature enables a writable overlay on top of `/opt` (or really, any
161+
toplevel or subdirectory baked into the image that is normally read-only).
162+
Changes persist across reboots but during updates, new files from the container
163+
image override any locally modified version. All other files persist.
164+
165+
To enable this feature, simply instantiate the `[email protected]`
166+
unit template on the target path. For example, for `/opt`:
167+
168+
```
169+
RUN systemctl enable [email protected]
170+
```

0 commit comments

Comments
 (0)