@@ -146,15 +146,17 @@ In the future, this command may perform more operations.
146
146
There is now an ` rpm-ostree compose image ` command which generates a new base image using a treefile:
147
147
148
148
```
149
- $ rpm-ostree compose image --initialize-mode=if-not-exists --format=ociarchive workstation-ostree-config/fedora-silverblue.yaml fedora-silverblue.ociarchive
149
+ $ rpm-ostree compose image --initialize-mode=if-not-exists --format=ociarchive \
150
+ workstation-ostree-config/fedora-silverblue.yaml fedora-silverblue.ociarchive
150
151
```
151
152
152
153
The ` --initialize-mode=if-not-exists ` command here is what you almost always want: to create
153
154
the image if it doesn't exist, but to otherwise check for changes. It isn't the default
154
155
for historical reasons.
155
156
156
157
```
157
- $ rpm-ostree compose image --initialize-mode=if-not-exists --format=registry workstation-ostree-config/fedora-silverblue.yaml quay.io/example/exampleos:latest
158
+ $ rpm-ostree compose image --initialize-mode=if-not-exists --format=registry \
159
+ workstation-ostree-config/fedora-silverblue.yaml quay.io/example/exampleos:latest
158
160
```
159
161
160
162
## Adding container image configuration
@@ -201,25 +203,39 @@ In ostree upstream, there is a simplistic CLI (and API) that "encapsulates"
201
203
a commit into a container image with a * single layer* :
202
204
203
205
```
204
- $ ostree container encapsulate --repo=/path/to/repo fedora/35/x86_64/silverblue docker://quay.io/myuser/fedora-silverblue:35
206
+ $ ostree container encapsulate --repo=/path/to/repo fedora/35/x86_64/silverblue \
207
+ docker://quay.io/myuser/fedora-silverblue:35
205
208
```
206
209
207
210
The ` encapsulate ` command accepts all the same "transport prefixes" as the ` skopeo `
208
211
CLI. For more information, see ` man skopeo ` .
209
212
210
- However, this "single layer" is not an efficient way to deliver content. It means
211
- that any time anything in the ostree commit changes, clients need to download
212
- a full new tarball.
213
+ ## Creating chunked images
213
214
214
- The ostree shared library has low level APIs that support creating reproducible
215
- "chunked" images. A key adavantage of this is that if e.g. just the kernel
216
- changes, one only downloads the layer containing the kernel/initramfs
217
- (plus a metadata layer) instead of everything.
215
+ The "single layer" image produced by ` ostree container encapsulate `
216
+ above is not an efficient way to deliver content. It means that any
217
+ time anything in the ostree commit changes, clients need to download a
218
+ full new tarball.
219
+
220
+ The ostree shared library has low level APIs that support creating
221
+ reproducible "chunked" images. A key adavantage of this is that if
222
+ e.g. just the kernel changes, one only downloads the layer containing
223
+ the kernel/initramfs (plus a metadata layer) instead of everything.
224
+ The algorithm uses generalized heuristics to pack the image content
225
+ together (primarily consulting RPM metadata) into a number of layers
226
+ in order to minimize the amount of data/layers modified when producing
227
+ updated images in the future. The ` --max-layers ` option may be
228
+ supplied to specify the number of layers; if not specified this
229
+ defaults to a maximum of 64 layers.
218
230
219
231
Use a command like this to generate chunked images:
220
232
221
233
```
222
- $ rpm-ostree compose container-encapsulate --repo=/path/to/repo fedora/35/x86_64/silverblue docker://quay.io/myuser/fedora-silverblue:35
234
+ $ rpm-ostree compose container-encapsulate --repo=/path/to/repo fedora/35/x86_64/silverblue \
235
+ docker://quay.io/myuser/fedora-silverblue:35
223
236
```
224
237
225
238
This "chunked" format is used by default by ` rpm-ostree compose image ` .
239
+
240
+ You can also create chunked images from pre-existing (typically
241
+ single-layer) images using [ ` rpm-ostree compose build-chunked-oci ` ] ( https://coreos.github.io/rpm-ostree/build-chunked-oci/ ) .
0 commit comments