forked from containers/bootc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
89 additions
and
124 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,65 @@ | ||
# Filesystem | ||
|
||
As noted in other chapters, the bootc project inherits | ||
a lot of code from the [ostree project](https://github.com/ostreedev/ostree/). | ||
|
||
However, bootc is intending to be a "fresh, new container-native interface". | ||
|
||
First, it is strongly recommended that bootc consumers use the ostree | ||
[composefs backend](https://ostreedev.github.io/ostree/composefs/); to do this, | ||
ensure that you have a `/usr/lib/ostree/prepare-root.conf` that contains at least | ||
|
||
```ini | ||
[composefs] | ||
enabled = true | ||
``` | ||
|
||
This will ensure that the entire `/` is a read-only filesystem. | ||
|
||
## `/usr` | ||
|
||
The overall recommendation is to keep all operating system content in `/usr`. See [UsrMove](https://fedoraproject.org/wiki/Features/UsrMove) for example. | ||
|
||
## `/etc` | ||
|
||
The `/etc` directory contains persistent state by default; however, | ||
it is suppported to enable the [`etc.transient` config option](https://ostreedev.github.io/ostree/man/ostree-prepare-root.html). | ||
|
||
When in persistent mode, it inherits the OSTree semantics of [performing a 3-way merge](https://ostreedev.github.io/ostree/atomic-upgrades/#assembling-a-new-deployment-directory) | ||
across upgrades. | ||
|
||
## `/var` | ||
|
||
Content in `/var` persists by default; it is however supported to make it or subdirectories | ||
mount points (whether network or `tmpfs`) | ||
|
||
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). | ||
|
||
This means that the content from the container image is copied at *initial installation time*, and not updated thereafter. | ||
|
||
## Other directories | ||
|
||
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. | ||
|
||
Besides those, for other toplevel directories such as `/usr` `/opt`, they will be lifecycled with the container image. | ||
|
||
### `/opt` | ||
|
||
In the default suggested model of using composefs (per above) the `/opt` directory will be read-only, alongside | ||
other toplevels such as `/usr`. | ||
|
||
Some software expects to be able to write to its own directory in `/opt/exampleapp`. For these | ||
cases, there are several options (containerizing the app, running it in a system unit that sets up custom mounts, etc.) | ||
|
||
#### Enabling transient root | ||
|
||
However, some use cases may find it easier to enable a fully transient writable rootfs by default. | ||
To do this, set the | ||
|
||
``` | ||
[root] | ||
transient = true | ||
``` | ||
|
||
option in `prepare-root.conf`. In particular this will allow software to write (transiently) to `/opt`, | ||
with symlinks to `/var` for content that should persist. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# How does the use of OCI artifacts intersect with this effort? | ||
|
||
The "bootc compatible" images are OCI container images; they do not rely on the [OCI artifact specification](https://github.com/opencontainers/image-spec/blob/main/artifacts-guidance.md) or [OCI referrers API](https://github.com/opencontainers/distribution-spec/blob/main/spec.md#enabling-the-referrers-api). | ||
|
||
It is foreseeable that users will need to produce "traditional" disk images (i.e. raw disk images, qcow2 disk images, Amazon AMIs, etc.) from the "bootc compatible" container images using additional tools. Therefore, it is reasonable that some users may want to encapsulate those disk images as an OCI artifact for storage and distribution. However, it is not a goal to use `bootc` to produce these "traditional" disk images nor to facilitate the encapsulation of those disk images as OCI artifacts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters