Skip to content

Commit 68cdc46

Browse files
committed
bootc-images: additional details about composing
This adds more verbose details about composing base images and makes some Markdown syntax improvements. Signed-off-by: Micah Abbott <[email protected]>
1 parent 3311087 commit 68cdc46

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

docs/bootc-images.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ nav_order: 2
55
# "bootc compatible" images
66

77
At the current time, it does not work to just do:
8-
```
8+
9+
```Dockerfile
910
FROM fedora
1011
RUN dnf -y install kernel
1112
```
13+
1214
or
13-
```
15+
16+
```Dockerfile
1417
FROM debian
1518
RUN apt install kernel
1619
```
@@ -30,29 +33,42 @@ for generating base images currently requires running
3033
through ostree tooling to generate an "ostree commit"
3134
which has some special formatting in the base image.
3235

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+
3350
However, the ostree usage is an implementation detail
3451
and the requirement on this will be lifted in the future.
3552

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-
4053
# Deriving from existing base images
4154

42-
However, it's important to emphasize that from one
55+
It's important to emphasize that from one
4356
of these specially-formatted base images, every
4457
tool and technique for container building applies!
4558
In other words it will Just Work to do
46-
```
59+
60+
```Dockerfile
4761
FROM <bootc base image>
48-
RUN dnf -y install foo && dnf clean all
62+
RUN dnf -y install foo && dnf clean all
4963
```
5064

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+
5169
## Using the `ostree container commit` command
5270

5371
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
5573
of some incompatibilities but is not a strict requirement today and will not be
5674
in the future.
57-
58-

0 commit comments

Comments
 (0)