Skip to content

Guide for building custom node images#97

Open
HarshwardhanPatil07 wants to merge 1 commit into
bootc-dev:mainfrom
HarshwardhanPatil07:docs-custom-node-images
Open

Guide for building custom node images#97
HarshwardhanPatil07 wants to merge 1 commit into
bootc-dev:mainfrom
HarshwardhanPatil07:docs-custom-node-images

Conversation

@HarshwardhanPatil07

Copy link
Copy Markdown
Collaborator

how to build a disk image with a custom or patched package and test it with bink. Covers two approaches:

  • Runtime update through bootc switch (no disk rebuild)
  • Full disk image rebuild for boot-critical changes

Closes: #91

Document how to build a disk image with a custom or patched package
and test it with bink. Covers two approaches:
- Runtime update via bootc switch (no disk rebuild)
- Full disk image rebuild for boot-critical changes

Includes concrete examples for COPR repos, local RPMs, binary
replacement, and building bootc from source using the bootc repo's
Dockerfile with the bink node image as base.

Closes: bootc-dev#91
Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
Comment on lines +36 to +43
# Check the ostree deployment
ostree admin status

# Show ostree commit details
ostree show --repo=/sysroot/ostree/repo <checksum>

# Check the origin file (which container image the node tracks)
sudo cat /sysroot/ostree/deploy/default/deploy/*.origin

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true for ostree but not for composefs. Can you please also add the other variant

```bash
bink node ssh node1 --cluster-name <name>

ostree admin status

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also provide the composefs version for completness.

- **Stage 1** (`Containerfile`): Builds a bootc OCI image from `quay.io/fedora/fedora-bootc:44`. Uses `bootc-base-imagectl build-rootfs` with `--install` flags for packages (kubernetes, CRI-O, etc.). Validated with `bootc container lint`.
- **Stage 2** (`Containerfile.disk`): Converts the bootc OCI image to a qcow2 disk using `bcvk to-disk`. The final container image contains only `/disk.qcow2` and `/images.txt`.

> **Important:** Do not run `podman build` directly on `node-images/fedora/Containerfile`. The `build-rootfs` command requires elevated privileges. Always use the Makefile targets (`make build-bootc-image`, `make build-disk-image`) which pass the correct flags (`--cap-add=all --security-opt=label=disable --device /dev/fuse`).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add this as N:B with the required flags and an example of the full podman command

--cluster-name custom-test
```

> **Note:** COPR repos should be used as an opt-in customization for debugging and testing, not as a permanent change to the default image. Upstream COPR updates can introduce unexpected changes that break CI.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided to use it in order to get the latest bootc. So this sentence it somehow contradicts what we are doing :D

NODE_IMAGE=localhost/custom-node:disk-composefs
```

## Testing with Multiple Nodes

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is superfluous it depends on the type of bug you are investigating. I would simply drop it

Comment on lines +315 to +337
## Troubleshooting

### KVM Permission Errors

```
qemu-system-x86_64: Could not access KVM kernel module: Permission denied
```

Add your user to the `kvm` group or set permissions: `sudo chmod 666 /dev/kvm`.

### `bootc container lint` Failures

The Containerfile runs `bootc container lint` at the end. Custom modifications must preserve:
- `/sbin/init` as the entrypoint (`CMD ["/sbin/init"]`)
- Labels: `containers.bootc 1` and `ostree.bootable 1`

### Disk Space

The qcow2 build via bcvk needs approximately 15 GB of temporary space. Free disk space or reduce the disk size with `DISK_SIZE=8G`.

### COPR Repo Not Found

Verify the Fedora version and architecture string matches the base image. For `quay.io/fedora/fedora-bootc:44`, use `fedora-44-x86_64`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these are really necessary. I would drop them


Add your user to the `kvm` group or set permissions: `sudo chmod 666 /dev/kvm`.

### `bootc container lint` Failures

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't the lint already tell you what it is going wrong?

@alicefr

alicefr commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Very nice guide, thanks for writing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document how to build a disk image and testing with a custom package

2 participants