@@ -136,15 +136,35 @@ a subdirectory of `/opt` such as `/opt/examplepkg`.
136
136
See [ building images] ( building/guidance.md ) for recommendations on how to build
137
137
container images and adjust the filesystem for cases like this.
138
138
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
+
139
143
#### Enabling transient root
140
144
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.
142
146
To do this, set the
143
147
144
148
``` toml
145
149
[root ]
146
150
transient = true
147
151
```
148
152
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