Skip to content

Commit 09fe389

Browse files
committed
docs: Even more about how bootc is not a container at runtime
This is definitely the #1 confusion many people have to start; it's very understandable! Because in theory we *could* have a runtime and a larger role, but it was an explicit choice not to do that. Signed-off-by: Colin Walters <[email protected]>
1 parent 2138aa0 commit 09fe389

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ for base operating system updates.
1212

1313
The container image includes a Linux kernel (in e.g. `/usr/lib/modules`),
1414
which is used to boot. At runtime on a target system, the base userspace is
15-
*not* itself running in a container by default. For example, assuming
15+
*not* itself running in a "container" by default. For example, assuming
1616
systemd is in use, systemd acts as pid1 as usual - there's no "outer" process.
17+
More about this in the docs; see below.
1718

1819
## Status
1920

docs/src/building/bootc-runtime.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@ Fundamentally, `bootc` reuses the [OCI image format](https://github.com/opencont
55
as a way to transport serialized filesystem trees with included metadata such as a `version`
66
label, etc.
77

8-
However, `bootc` generally ignores the [Container configuration](https://github.com/opencontainers/image-spec/blob/main/config.md)
9-
section at runtime today.
8+
A bootc container operates in two basic modes. First, when invoked by a container run time such as `podman` or `docker` (typically as part of a build process), the bootc container behaves exactly the same as any other container. For example, although there is a kernel embedded in the container image, it is not executed - the host kernel is used. There's no additional mount namespaces, etc. Ultimately, the container runtime is in full control here.
109

11-
Container runtimes like `podman` and `docker` of course *will* interpret this metadata
12-
when running a bootc container image as a container.
10+
The second, and most important mode of operation is when a bootc container is installed to a physical or virtual machine. Here, bootc is in control; the container runtime used to build is no longer relevant. However, it's *very* important to understand that bootc's role is quite limited:
11+
12+
- On boot, there is code in the initramfs to do a "chroot" equivalent into the target filesystem root
13+
- On upgrade, bootc will fetch new content, but this will not affect the running root
14+
15+
Crucially, besides setting up some mounts, bootc itself does not act as any kind of "container runtime". It does not set up pid or other namespace, does not change cgroups, etc. That remains the role of other code (typically systemd). `bootc` is not a persistent daemon by default; it does not impose any runtime overhead.
16+
17+
Another example of this: While one can add [Container configuration](https://github.com/opencontainers/image-spec/blob/main/config.md) metadata, `bootc` generally ignores that at runtime today.
1318

1419
## Labels
1520

docs/src/filesystem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ files are often bound to the operating system binaries in `/usr`.
103103

104104
But `/var` has arbitrarily large data (system logs, databases, etc.). It would
105105
also not be expected to be rolled back if the operating system state is rolled
106-
back. A simple exmaple is that an `apt|dnf downgrade postgresql` should not
106+
back. A simple example is that an `apt|dnf downgrade postgresql` should not
107107
affect the physical database in general in `/var/lib/postgres`. Similarly,
108108
a bootc update or rollback should not affect this application data.
109109

0 commit comments

Comments
 (0)