@@ -140,10 +140,6 @@ and `/home`. The choice for how these work is up to the base image, but
140
140
a common default for generic base images is to have both be machine-local persistent state.
141
141
In this model ` /home ` would be a symlink to ` /var/home/someuser ` .
142
142
143
- But it is also valid to default to having e.g. ` /home ` be a ` tmpfs `
144
- to ensure user data is cleaned up across reboots (and this pairs particularly
145
- well with a transient ` /etc ` as well).
146
-
147
143
#### Injecting users and SSH keys via at system provisioning time
148
144
149
145
For base images where ` /etc ` and ` /var ` are configured to persist by default, it
@@ -163,6 +159,26 @@ It is intended that these flows work equivalently in a bootc-compatible
163
159
system, to support users directly installing "generic" base images, without
164
160
requiring changes to the tools above.
165
161
162
+ #### Transient home directories
163
+
164
+ Many operating system deployments will want to minimize persistent,
165
+ mutable and executable state - and user home directories are that
166
+
167
+ But it is also valid to default to having e.g. ` /home ` be a ` tmpfs `
168
+ to ensure user data is cleaned up across reboots (and this pairs particularly
169
+ well with a transient ` /etc ` as well):
170
+
171
+ In order to set up the user's home directory to e.g. inject SSH ` authorized_keys `
172
+ or other files, a good approach is to use systemd ` tmpfiles.d ` snippets:
173
+
174
+ ```
175
+ f~ /home/someuser/.ssh/authorized_keys 600 someuser someuser - <base64 encoded data>
176
+ ```
177
+ which can be embedded in the image as ` /usr/lib/tmpfiles.d/someuser-keys.conf ` .
178
+
179
+ Or a service embedded in the image can fetch keys from the network and write
180
+ them; this is the pattern used by cloud-init and [ afterburn] ( https://github.com/coreos/afterburn ) .
181
+
166
182
### UID/GID drift
167
183
168
184
Ultimately the ` /etc/passwd ` and similar files are a mapping
0 commit comments