@@ -5,12 +5,15 @@ nav_order: 2
5
5
# "bootc compatible" images
6
6
7
7
At the current time, it does not work to just do:
8
- ```
8
+
9
+ ``` Dockerfile
9
10
FROM fedora
10
11
RUN dnf -y install kernel
11
12
```
13
+
12
14
or
13
- ```
15
+
16
+ ``` Dockerfile
14
17
FROM debian
15
18
RUN apt install kernel
16
19
```
@@ -30,29 +33,42 @@ for generating base images currently requires running
30
33
through ostree tooling to generate an "ostree commit"
31
34
which has some special formatting in the base image.
32
35
36
+ The two most common ways to do this are to either:
37
+
38
+ 1 . compose a compatible OCI image directly via [ ` rpm-ostree compose image ` ] ( https://coreos.github.io/rpm-ostree/container/#creating-base-images )
39
+ 1 . encapsulate an ostree commit using ` rpm-ostree compose container-encapsulate `
40
+
41
+ The first method is most direct, as it streamlines the process of
42
+ creating a base image and writing to a registry. The second method
43
+ may be preferable if you already have a build process that produces ` ostree `
44
+ commits as an output (e.g. using [ osbuild] ( https://www.osbuild.org/guides/image-builder-on-premises/building-ostree-images.html )
45
+ to produce ` ostree ` commit artifacts.)
46
+
47
+ The requirement for both methods is that your initial treefile/manifest
48
+ ** MUST** include the ` bootc ` package in list of packages included in your compose.
49
+
33
50
However, the ostree usage is an implementation detail
34
51
and the requirement on this will be lifted in the future.
35
52
36
- For example, the [ rpm-ostree compose image] ( https://coreos.github.io/rpm-ostree/container/#creating-base-images )
37
- tooling currently streamlines creating base images, operating just
38
- on a declarative input and writing to a registry.
39
-
40
53
# Deriving from existing base images
41
54
42
- However, it 's important to emphasize that from one
55
+ It 's important to emphasize that from one
43
56
of these specially-formatted base images, every
44
57
tool and technique for container building applies!
45
58
In other words it will Just Work to do
46
- ```
59
+
60
+ ``` Dockerfile
47
61
FROM <bootc base image>
48
- RUN dnf -y install foo && dnf clean all
62
+ RUN dnf -y install foo && dnf clean all
49
63
```
50
64
65
+ You can then use ` podman build ` , ` buildah ` , ` docker build ` , or any other container
66
+ build tool to produce your customized image. The only requirement is that the
67
+ container build tool supports producing OCI container images.
68
+
51
69
## Using the ` ostree container commit ` command
52
70
53
71
As an opt-in optimization today, you can also add ` ostree container commit `
54
- as part of your ` RUN ` invocations. This will perform early detection
72
+ as part of your ` RUN ` invocations. This will perform early detection
55
73
of some incompatibilities but is not a strict requirement today and will not be
56
74
in the future.
57
-
58
-
0 commit comments