You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/filesystem.md
+16-8Lines changed: 16 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,12 +115,25 @@ undefined behavior. There is a check for this in `bootc container lint`.
115
115
116
116
Content in `/var` persists by default; it is however supported to make it or subdirectories
117
117
mount points (whether network or `tmpfs`). There is exactly one `/var`. If it is
118
-
not a distinct partition, then "physically" currently it is a bind mount into
118
+
not a distinct partition, then it is automatically made a bind from
119
119
`/ostree/deploy/$stateroot/var` and shared across "deployments" (bootloader entries).
120
120
121
-
As of OSTree v2024.3, by default [content in /var acts like a Docker VOLUME /var](https://github.com/ostreedev/ostree/pull/3166/commits/f81b9fa1666c62a024d5ca0bbe876321f72529c7).
121
+
You may include content in `/var` in your image - and reference base images may
122
+
have a few basic directories such as `/var/tmp` (in order to ease use in container
123
+
builds).
122
124
123
-
This means that the content from the container image is copied at initial installation time, and *not updated thereafter*.
125
+
However, it is very important to understand that content included in `/var`
126
+
in the container image acts like a Docker `VOLUME /var`. This means its
127
+
contents are unpacked *only from the initial image* - subsequent changes to `/var`
128
+
in a container image are not automatically applied.
129
+
130
+
A common case is for applications to want some directory structure (e.g. `/var/lib/postgresql`) to be pre-created.
131
+
It's recommended to use [systemd tmpfiles.d](https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html)
132
+
for this. An even better approach where applicable is [StateDirectory=](https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#RuntimeDirectory=)
133
+
in units.
134
+
135
+
As of bootc 1.1.6, the `bootc container lint` command will check for missing `tmpfiles.d`
136
+
entries and warn.
124
137
125
138
Note this is very different from the handling of `/etc`. The rationale for this is
126
139
that `/etc` is relatively small configuration files, and the expected configuration
@@ -139,11 +152,6 @@ and ready, but only take effect on reboot).
139
152
In general, this is the same rationale for Docker `VOLUME`: decouple the application
140
153
code from its data.
141
154
142
-
A common case is for applications to want some directory structure (e.g. `/var/lib/postgresql`) to be pre-created.
143
-
It's recommended to use [systemd tmpfiles.d](https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html)
144
-
for this. An even better approach where applicable is [StateDirectory=](https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#RuntimeDirectory=)
145
-
in units.
146
-
147
155
## Other directories
148
156
149
157
It is not supported to ship content in `/run` or `/proc` or other [API Filesystems](https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/) in container images.
0 commit comments