Skip to content

Commit 181efce

Browse files
committed
doc/ephemeral: Describe how to detect the environment
`bcvk to-disk quay.io/fedora/fedora-coreos` is broken because it has a generator that fails in this environment. Signed-off-by: Colin Walters <[email protected]>
1 parent e46212b commit 181efce

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/src/ephemeral-run.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@ bcvk ephemeral run-ssh quay.io/fedora/fedora-bootc:42
2222
bcvk ephemeral run --memory 4096 --cpus 4 --name myvm quay.io/fedora/fedora-bootc:42
2323
```
2424

25+
## Detecting an ephemeral environment
26+
27+
Conceptually now with `bcvk ephemeral`, there's *four* different ways to run
28+
a bootc container:
29+
30+
- `podman|docker run <image> bash` - directly run a shell (or other process) the container without systemd. Uses the host kernel, not kernel in the container.
31+
- `podman|docker run <image>` - by default runs systemd. See also <https://docs.fedoraproject.org/en-US/bootc/provisioning-container/>. Uses the host kernel, not kernel in the container.
32+
- `bootc install` - Run directly on metal or a virtualized environment. Uses the kernel in the container.
33+
- `bcvk ephemeral` - Run as a virtual machine, but *not* a true "bootc install". Uses the kernel in the container.
34+
35+
Some systemd units may need adaption to work in all of these modes. For example, if you have a systemd generator
36+
which synthesizes mount units for expected partitions, it can use `ConditionVirtualization=!container` to skip
37+
those in the first two cases (ensuring it still runs after a `bootc install`), but that won't be skipped in `bcvk ephemeral`
38+
even though there won't be any block devices (by default).
39+
40+
At the current time there is not a dedicated way to detect `bcvk ephemeral`, but `ConditionKernelCommandLine=!rootfstype=virtiofs`
41+
should work reliably in the future.
42+
2543
## Use Cases
2644

2745
- Quick testing of bootc images

0 commit comments

Comments
 (0)