2
2
nav_order : 2
3
3
---
4
4
5
- # ` bootc install `
5
+ # Installing " bootc compatible" images
6
6
7
7
A key goal of the bootc project is to think of bootable operating systems
8
8
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;
17
17
is ` /usr/lib/modules/$kver/vmlinuz ` , and the initramfs should be in ` initramfs.img `
18
18
in that directory.
19
19
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.
27
26
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
30
33
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 )
32
35
for many bare metal setups. But the problem is that coreos-installer
33
36
is oriented to installing raw disk images. This means that if
34
37
one creates a custom derived container, then it's required for
35
38
one to also generate a raw disk image to install. This is a large
36
39
ergonomic hit.
37
40
38
- With ` bootc install ` , no extra steps are required. Every container
41
+ With the ` bootc ` install methods , no extra steps are required. Every container
39
42
image comes with a basic installer.
40
43
41
44
## Executing ` bootc install `
42
45
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
44
51
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.
46
55
47
- Here's an example:
56
+ Here's an example of using ` bootc install ` (root/elevated permission required) :
48
57
49
- ``` sh
58
+ ``` bash
50
59
podman run --rm --privileged --pid=host --security-opt label=type:unconfined_t < image> bootc install --target-no-signature-verification /path/to/disk
51
60
```
52
61
53
62
Note that while ` --privileged ` is used, this command will not perform any
54
63
destructive action on the host system. Among other things, ` --privileged `
55
64
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.
57
66
58
67
The ` --pid=host --security-opt label=type:unconfined_t ` today
59
68
make it more convenient for bootc to perform some privileged
60
69
operations; in the future these requirement may be dropped.
61
70
71
+ Jump to the section for [ ` install-to-filesystem ` ] ( #more-advanced-installation ) later
72
+ in this document for additional information about that method.
73
+
62
74
### "day 2" updates, security and fetch configuration
63
75
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
65
77
for the ` podman run ` invocation and use it to set up "day 2" OS updates that ` bootc update `
66
78
will use.
67
79
@@ -74,7 +86,7 @@ By default, the installation process will verify that the container (representin
74
86
can fetch its own updates. A common cause of failure here is not changing the security settings
75
87
in ` /etc/containers/policy.json ` in the target OS to verify signatures.
76
88
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 ` .
78
90
79
91
Additionally note that to perform an install with a target image reference set to an
80
92
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`.
84
96
85
97
### Operating system install configuration required
86
98
87
- The container image must define its default install configuration. For example,
99
+ The container image ** MUST ** define its default install configuration. For example,
88
100
create ` /usr/lib/bootc/install/00-exampleos.toml ` with the contents:
89
101
90
102
``` toml
91
103
[install ]
92
104
root-fs-type = " xfs"
93
105
```
94
106
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.
96
108
97
109
Configuration files found in this directory will be merged, with higher alphanumeric values
98
110
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
100
112
prior setting.
101
113
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
-
107
114
## Installing an "unconfigured" image
108
115
109
116
The bootc project aims to support generic/general-purpose operating
@@ -128,12 +135,12 @@ the configuration comes from a place *external* to the image.
128
135
129
136
### Injecting configuration into a custom image
130
137
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
132
139
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).
134
141
135
142
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.
137
144
For example, in the default ostree model, ` /root ` is ` /var/roothome `
138
145
and ` /home ` is ` /var/home ` . Content in ` /var ` cannot be shipped
139
146
in the image - it is per machine state.
@@ -207,15 +214,16 @@ somewhat destructive operation for the existing Linux installation.
207
214
Also, because the filesystem is reused, it's required that the target system kernel
208
215
support the root storage setup already initialized.
209
216
210
- The core command should look like this:
217
+ The core command should look like this (root/elevated permission required) :
211
218
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
216
224
```
217
225
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
219
227
be useful, because it allows the new image to automatically import data from the previous
220
228
host system! For example, things like SSH keys or container images can be copied
221
229
and then deleted from the original.
0 commit comments