Skip to content

Commit d02b381

Browse files
committed
install: additional details and Markdown cleanup
I added some additional details around the install process and did Markdown cleanups, spelling corrections, grammar fixes, etc. Signed-off-by: Micah Abbott <[email protected]>
1 parent 68cdc46 commit d02b381

File tree

1 file changed

+44
-36
lines changed

1 file changed

+44
-36
lines changed

docs/install.md

Lines changed: 44 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
nav_order: 2
33
---
44

5-
# `bootc install`
5+
# Installing "bootc compatible" images
66

77
A key goal of the bootc project is to think of bootable operating systems
88
as container images. Docker/OCI container images are just tarballs
@@ -17,51 +17,63 @@ The Linux kernel (and optionally initramfs) is embedded in the container image;
1717
is `/usr/lib/modules/$kver/vmlinuz`, and the initramfs should be in `initramfs.img`
1818
in that directory.
1919

20-
The `bootc install` command bridges the two worlds of a standard runnable OCI image
21-
and a bootable system by running tooling
22-
logic embedded in the container image to create the filesystem and
23-
bootloader setup dynamically, using tools already embedded in the container
24-
image. This requires running the container via `--privileged`; it uses
25-
the running Linux kernel to write the file content from the running container image;
26-
not the kernel inside the container.
20+
The `bootc install` and `boot install-to-filesystem` commands bridge the two worlds
21+
of a standard, runnable OCI image and a bootable system by running tooling logic embedded
22+
in the container image to create the filesystem and bootloader setup dynamically.
23+
This requires running the container via `--privileged`; it uses the running Linux kernel
24+
on the host to write the file content from the running container image; not the kernel
25+
inside the container.
2726

28-
However nothing *else* (external) is required to perform a basic installation
29-
to disk. This is motivated by experience gained from the Fedora CoreOS
27+
However, nothing *else* (external) is required to perform a basic installation
28+
to disk. (The one exception to host requirements today is that the host must
29+
have `skopeo` installed. This is a bug; more information in
30+
[this issue](https://github.com/containers/bootc/issues/81).)
31+
32+
This is motivated by experience gained from the Fedora CoreOS
3033
project where today the expectation is that one boots from a pre-existing disk
31-
image (AMI, qcow2, etc) or use [coreos-installer](https://github.com/coreos/coreos-installer)
34+
image (AMI, qcow2, etc) or uses [coreos-installer](https://github.com/coreos/coreos-installer)
3235
for many bare metal setups. But the problem is that coreos-installer
3336
is oriented to installing raw disk images. This means that if
3437
one creates a custom derived container, then it's required for
3538
one to also generate a raw disk image to install. This is a large
3639
ergonomic hit.
3740

38-
With `bootc install`, no extra steps are required. Every container
41+
With the `bootc` install methods, no extra steps are required. Every container
3942
image comes with a basic installer.
4043

4144
## Executing `bootc install`
4245

43-
The installation command must be run from the container image
46+
The two installation commands allow you to install the container image
47+
either directly to a block device (`bootc install`) or to an existing
48+
filesystem (`bootc install-to-filesystem`).
49+
50+
The installation commands **MUST** be run **from** the container image
4451
that will be installed, using `--privileged` and a few
45-
other options.
52+
other options. This means you are (currently) not able to install `bootc`
53+
to an existing system and install your container image. Failure to run
54+
`bootc` from a container image will result in an error.
4655

47-
Here's an example:
56+
Here's an example of using `bootc install` (root/elevated permission required):
4857

49-
```sh
58+
```bash
5059
podman run --rm --privileged --pid=host --security-opt label=type:unconfined_t <image> bootc install --target-no-signature-verification /path/to/disk
5160
```
5261

5362
Note that while `--privileged` is used, this command will not perform any
5463
destructive action on the host system. Among other things, `--privileged`
5564
makes sure that all host devices are mounted into container. `/path/to/disk` is
56-
the host's block device `<image>` will be installed on.
65+
the host's block device where `<image>` will be installed on.
5766

5867
The `--pid=host --security-opt label=type:unconfined_t` today
5968
make it more convenient for bootc to perform some privileged
6069
operations; in the future these requirement may be dropped.
6170

71+
Jump to the section for [`install-to-filesystem`](#more-advanced-installation) later
72+
in this document for additional information about that method.
73+
6274
### "day 2" updates, security and fetch configuration
6375

64-
Note that by default the `bootc install` path will find the pull specification used
76+
By default the `bootc install` path will find the pull specification used
6577
for the `podman run` invocation and use it to set up "day 2" OS updates that `bootc update`
6678
will use.
6779

@@ -74,7 +86,7 @@ By default, the installation process will verify that the container (representin
7486
can fetch its own updates. A common cause of failure here is not changing the security settings
7587
in `/etc/containers/policy.json` in the target OS to verify signatures.
7688

77-
If you are pushing an unsigned image, you must specify `bootc install --target-no-signature-verification`.
89+
If you are pushing an unsigned image, you **MUST** specify `bootc install --target-no-signature-verification`.
7890

7991
Additionally note that to perform an install with a target image reference set to an
8092
authenticated registry, you must provide a pull secret. One path is to embed the pull secret into
@@ -84,26 +96,21 @@ in that case you will need to specify `--skip-fetch-check`.
8496

8597
### Operating system install configuration required
8698

87-
The container image must define its default install configuration. For example,
99+
The container image **MUST** define its default install configuration. For example,
88100
create `/usr/lib/bootc/install/00-exampleos.toml` with the contents:
89101

90102
```toml
91103
[install]
92104
root-fs-type = "xfs"
93105
```
94106

95-
At the current time, `root-fs-type` is the only available configuration option, and it must be set.
107+
At the current time, `root-fs-type` is the only available configuration option, and it **MUST** be set.
96108

97109
Configuration files found in this directory will be merged, with higher alphanumeric values
98110
taking precedence. If for example you are building a derived container image from the above OS,
99-
you coudl create a `50-myos.toml` that sets `root-fs-type = "btrfs"` which will override the
111+
you could create a `50-myos.toml` that sets `root-fs-type = "btrfs"` which will override the
100112
prior setting.
101113

102-
### Note: Today `bootc install` has a host requirement on `skopeo`
103-
104-
The one exception to host requirements today is that the host must
105-
have `skopeo` installed. This is a bug; more information in [this issue](https://github.com/containers/bootc/issues/81).
106-
107114
## Installing an "unconfigured" image
108115

109116
The bootc project aims to support generic/general-purpose operating
@@ -128,12 +135,12 @@ the configuration comes from a place *external* to the image.
128135

129136
### Injecting configuration into a custom image
130137

131-
But a new super-power with `bootc` is that you can also easily instead
138+
But a new super-power with `bootc` is that you can also easily
132139
create a derived container that injects your desired configuration,
133-
alongside any additional executable code (packages, etc).
140+
alongside any additional executable code (binaries, packages, scripts, etc).
134141

135142
The expectation is that most operating systems will be designed such
136-
that user state i.e. `/root` and `/home` will be on a separate persistent data store.
143+
that user state i.e. `/root` and `/home` will be on a separate, persistent data store.
137144
For example, in the default ostree model, `/root` is `/var/roothome`
138145
and `/home` is `/var/home`. Content in `/var` cannot be shipped
139146
in the image - it is per machine state.
@@ -207,15 +214,16 @@ somewhat destructive operation for the existing Linux installation.
207214
Also, because the filesystem is reused, it's required that the target system kernel
208215
support the root storage setup already initialized.
209216

210-
The core command should look like this:
217+
The core command should look like this (root/elevated permission required):
211218

212-
```sh
213-
podman run --rm --privileged -v /:/target --pid=host --security-opt label=type:unconfined_t \
214-
<image> \
215-
bootc install-to-filesystem --replace=alongside /target
219+
```bash
220+
podman run --rm --privileged -v /:/target \
221+
--pid=host --security-opt label=type:unconfined_t \
222+
<image> \
223+
bootc install-to-filesystem --replace=alongside /target
216224
```
217225

218-
At the current time, leftover data in `/` is *not* automatically cleaned up. This can
226+
At the current time, leftover data in `/` is **NOT** automatically cleaned up. This can
219227
be useful, because it allows the new image to automatically import data from the previous
220228
host system! For example, things like SSH keys or container images can be copied
221229
and then deleted from the original.

0 commit comments

Comments
 (0)