Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
custom_edit_url: https://github.com/osbuild/image-builder/blob/main/doc/10-repositories.md
custom_edit_url: https://github.com/osbuild/image-builder/blob/main/doc/20-advanced/10-repositories.md
---
# Repository Management

<!--
[//]: # ( DO NOT MODIFY THIS FILE! )
[//]: # ( This content is generated by `scripts/pull_readmes.py` )
[//]: # ( Rather change the source of this: https://github.com/osbuild/image-builder/blob/main/doc/10-repositories.md )
[//]: # ( Rather change the source of this: https://github.com/osbuild/image-builder/blob/main/doc/20-advanced/10-repositories.md )
-->

When building package based images `image-builder` downloads packages from pre-defined repositories. `image-builder` ships with built-in definitions and repositories for a [list of distributions](../10-faq.md#built-in-distributions). These are used when building artifacts.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
custom_edit_url: https://github.com/osbuild/image-builder/blob/main/doc/05-sources-of-configuration.md
custom_edit_url: https://github.com/osbuild/image-builder/blob/main/doc/20-advanced/20-bootc/05-sources-of-configuration.md
---
# Sources of Configuration

<!--
[//]: # ( DO NOT MODIFY THIS FILE! )
[//]: # ( This content is generated by `scripts/pull_readmes.py` )
[//]: # ( Rather change the source of this: https://github.com/osbuild/image-builder/blob/main/doc/05-sources-of-configuration.md )
[//]: # ( Rather change the source of this: https://github.com/osbuild/image-builder/blob/main/doc/20-advanced/20-bootc/05-sources-of-configuration.md )
-->

In `bootc`-land it is preferred for the source of truth to be the container itself. For `image-builder` that means that certain instructions can be stored inside the container and will be used by `image-builder` when present. We get various bits and bobs from different places . This page describes what we get from where.
Expand Down Expand Up @@ -286,22 +286,24 @@ partition_table:

### Deployment Variants

Containers can ship multiple `disk.yaml` and/or `iso.yaml` configurations as *deployment variants*. Variants allow a single container image to produce different disk layouts depending on the target environment, for example a `secure-execution` variant with verity partitions for s390x, or `btrfs` vs `ext4` variants for Fedora images.
Containers can ship multiple `disk.yaml`, `iso.yaml`, and/or `extras.yaml` configurations as *deployment variants*. Variants allow a single container image to produce different disk layouts depending on the target environment, for example a `secure-execution` variant with verity partitions for s390x, or `btrfs` vs `ext4` variants for Fedora images.

Variants are placed in the `variant.d/` subdirectory, with each variant in its own named directory:

```
/usr/lib/image-builder/bootc/
├── disk.yaml # default configuration
├── iso.yaml # default ISO configuration
├── extras.yaml # default extras configuration
└── variant.d/
├── btrfs/
│ └── disk.yaml # btrfs partition layout
│ ├── disk.yaml # btrfs partition layout
│ └── extras.yaml # btrfs-specific extras
└── secure-execution/
└── disk.yaml # s390x SE partition layout
```

Each variant directory may contain a `disk.yaml` and/or `iso.yaml`. When a variant is selected at build time with `--bootc-variant`, `image-builder` uses the variant's configuration files. If a variant provides only `disk.yaml` but not `iso.yaml` (or vice versa), `image-builder` falls back to the default configuration for the missing file.
Each variant directory may contain a `disk.yaml`, `iso.yaml`, and/or `extras.yaml`. When a variant is selected at build time with `--bootc-variant`, `image-builder` uses the variant's configuration files. For any file not provided by the variant, `image-builder` falls back to the default configuration.

Users can list available variants and select one at build time:

Expand All @@ -328,3 +330,31 @@ grub2:
initrd: "/images/pxeboot/initrd.img"
```

### `extras.yaml`

A YAML file that declares additional build artifacts ("extras") that `image-builder` can produce alongside the main disk image. Currently only partition extras are supported, which extract individual partitions from the built disk image as separate files.

The canonical location for this file is `/usr/lib/image-builder/bootc/extras.yaml`. Like `disk.yaml` and `iso.yaml`, this file supports [deployment variant](#deployment-variants) overrides via `variant.d/<name>/extras.yaml`.

```yaml
partitions:
boot:
mountpoint: /boot
filename: boot.img
compression: xz
data:
mountpoint: /var/data
```

`partitions` is a map where each key is the name of the extra and each value is an object with the following properties:

- `mountpoint`, a `string` identifying which partition to extract from the disk image. This must match a mountpoint defined in the partition table (either from `disk.yaml` or the base partition table). For mountpoints inside container types (Btrfs, LVM, LUKS, etc.) the entire enclosing partition is exported rather than just the individual mountpoint.
- `filename`, an *optional* `string` to override the output filename. If omitted, the file is named `<name>.raw` (or `<name>.raw.<ext>` when compressed).
- `compression`, an *optional* `string` specifying the compression format to apply to the extracted partition (e.g. `xz`, `zstd`).

Extras defined in this file are visible in `image-builder bootc inspect` output and can be included in a build with `--with-extra`:

```sh
image-builder build --type qcow2 --with-extra partition:boot ...
```

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
custom_edit_url: https://github.com/osbuild/image-builder/blob/main/doc/10-isos.md
custom_edit_url: https://github.com/osbuild/image-builder/blob/main/doc/20-advanced/20-bootc/10-isos.md
---
# ISOs

<!--
[//]: # ( DO NOT MODIFY THIS FILE! )
[//]: # ( This content is generated by `scripts/pull_readmes.py` )
[//]: # ( Rather change the source of this: https://github.com/osbuild/image-builder/blob/main/doc/10-isos.md )
[//]: # ( Rather change the source of this: https://github.com/osbuild/image-builder/blob/main/doc/20-advanced/20-bootc/10-isos.md )
-->

## Generic
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
custom_edit_url: https://github.com/osbuild/image-builder/blob/main/doc/50-migration.md
custom_edit_url: https://github.com/osbuild/image-builder/blob/main/doc/20-advanced/20-bootc/50-migration.md
---
# Migrating from `bootc-image-builder`

<!--
[//]: # ( DO NOT MODIFY THIS FILE! )
[//]: # ( This content is generated by `scripts/pull_readmes.py` )
[//]: # ( Rather change the source of this: https://github.com/osbuild/image-builder/blob/main/doc/50-migration.md )
[//]: # ( Rather change the source of this: https://github.com/osbuild/image-builder/blob/main/doc/20-advanced/20-bootc/50-migration.md )
-->

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
custom_edit_url: https://github.com/osbuild/image-builder/blob/main/doc/index.md
custom_edit_url: https://github.com/osbuild/image-builder/blob/main/doc/20-advanced/20-bootc/index.md
---
# Advanced `bootc` Topics

<!--
[//]: # ( DO NOT MODIFY THIS FILE! )
[//]: # ( This content is generated by `scripts/pull_readmes.py` )
[//]: # ( Rather change the source of this: https://github.com/osbuild/image-builder/blob/main/doc/index.md )
[//]: # ( Rather change the source of this: https://github.com/osbuild/image-builder/blob/main/doc/20-advanced/20-bootc/index.md )
-->

- [Sources of Configuration](./05-sources-of-configuration.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
custom_edit_url: https://github.com/osbuild/image-builder/blob/main/doc/index.md
custom_edit_url: https://github.com/osbuild/image-builder/blob/main/doc/20-advanced/index.md
---
# Advanced

<!--
[//]: # ( DO NOT MODIFY THIS FILE! )
[//]: # ( This content is generated by `scripts/pull_readmes.py` )
[//]: # ( Rather change the source of this: https://github.com/osbuild/image-builder/blob/main/doc/index.md )
[//]: # ( Rather change the source of this: https://github.com/osbuild/image-builder/blob/main/doc/20-advanced/index.md )
-->

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Library development",
"position": 40
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
custom_edit_url: https://github.com/osbuild/images/blob/main/docs/developer/README.md
custom_edit_url: https://github.com/osbuild/image-builder/blob/main/docs/developer/README.md
---
# Hacking on osbuild/images

<!--
[//]: # ( DO NOT MODIFY THIS FILE! )
[//]: # ( This content is generated by `scripts/pull_readmes.py` )
[//]: # ( Rather change the source of this: https://github.com/osbuild/images/blob/main/docs/developer/README.md )
[//]: # ( Rather change the source of this: https://github.com/osbuild/image-builder/blob/main/docs/developer/README.md )
-->

## Local development environment
Expand All @@ -27,11 +27,11 @@ See [the developer guide on osbuild.org](https://osbuild.org/docs/developer-guid
Guidelines specific to this repository:
- Each commit should compile successfully. This is not checked or enforced. Commits should fail to compile only when it's absolutely necessary (e.g. for readability).
- If possible, unit tests should pass on each commit as well, however readability and clean patches are preferred, so this is not a strict requirement.
- The [manifest checksum](https://github.com/osbuild/images/tree/main/test/data/manifest-checksums.txt) file must be valid for every commit. Use the [tools/gen-manifest-checksums.sh](https://github.com/osbuild/images/tree/main/tools/gen-manifest-checksums.sh) script to generate the file if needed.
- The [manifest checksum](https://github.com/osbuild/image-builder/tree/main/test/data/manifest-checksums.txt) file must be valid for every commit. Use the [tools/gen-manifest-checksums.sh](https://github.com/osbuild/image-builder/tree/main/tools/gen-manifest-checksums.sh) script to generate the file if needed.
- The validity of the manifest checksum file is checked for every commit in a PR.
- Commits that fail to compile are skipped.
- Commits that change the file should include a short description in the commit message about how the manifests have changed, unless it is obvious from the code changes.
- See the [Diffing manifests section of the Developer documentation](https://github.com/osbuild/images/tree/main/docs/developer/cmds.md#diffing-manifests) for more information.
- See the [Diffing manifests section of the Developer documentation](https://github.com/osbuild/image-builder/tree/main/docs/developer/cmds.md#diffing-manifests) for more information.

## Tests

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
custom_edit_url: https://github.com/osbuild/images/blob/main/docs/developer/cmds.md
custom_edit_url: https://github.com/osbuild/image-builder/blob/main/docs/developer/cmds.md
---
### Useful cmds

Expand Down Expand Up @@ -41,11 +41,11 @@ a new image type, might be:
2. Make changes in an existing image definition or add a new image type.
3. Add appropriate configuration changes:
- If a new image type is added, add it to the [config
list](https://github.com/osbuild/images/tree/main/docs/developer/test/config-list.json) under an appropriate configuration file or
list](https://github.com/osbuild/image-builder/tree/main/docs/developer/test/config-list.json) under an appropriate configuration file or
write a new one.
- If an existing image type is being modified, and the change depends on an
image customization, make sure the modification is covered by an existing
[test config](https://github.com/osbuild/images/tree/main/docs/developer/test/configs).
[test config](https://github.com/osbuild/image-builder/tree/main/docs/developer/test/configs).
4. Generate the relevant manifests without content (`-packages=false
-containers=false -commits=false`).
- If the change depends on a customization, it might be more useful to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
custom_edit_url: https://github.com/osbuild/images/blob/main/docs/developer/code-manifest-generation.md
custom_edit_url: https://github.com/osbuild/image-builder/blob/main/docs/developer/code-manifest-generation.md
---
# Manifest generation

<!--
[//]: # ( DO NOT MODIFY THIS FILE! )
[//]: # ( This content is generated by `scripts/pull_readmes.py` )
[//]: # ( Rather change the source of this: https://github.com/osbuild/images/blob/main/docs/developer/code-manifest-generation.md )
[//]: # ( Rather change the source of this: https://github.com/osbuild/image-builder/blob/main/docs/developer/code-manifest-generation.md )
-->

This document explains how manifests are generated in code. It is useful for
Expand Down
Loading
Loading