add image builder notes
This commit is contained in:
66
active/software_osbuild/image_builder.md
Normal file
66
active/software_osbuild/image_builder.md
Normal file
@@ -0,0 +1,66 @@
|
||||
# Image Builder
|
||||
|
||||
<https://osbuild.org/docs/user-guide/blueprint-reference/>
|
||||
|
||||
## Warning
|
||||
|
||||
From the [Red Hat
|
||||
Documentation](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html-single/composing_installing_and_managing_rhel_for_edge_images/index):
|
||||
|
||||
> You cannot build an operating system image that differs from the RHEL image
|
||||
> builder host. For example, you cannot use a RHEL system to build Fedora or
|
||||
> CentOS images.
|
||||
|
||||
## Installing
|
||||
|
||||
```bash
|
||||
# Install the packages
|
||||
dnf install -y osbuild-composer composer-cli
|
||||
|
||||
# Start/enable the service
|
||||
systemctl enable --now osbuild-composer.socket
|
||||
|
||||
# Optional: add your user to the weldr group
|
||||
sudo usermod -aG weldr $USER
|
||||
|
||||
# Optional: cockpit dependency
|
||||
dnf install -y cockpit-composer
|
||||
```
|
||||
|
||||
## Building Images
|
||||
|
||||
1. Create a toml file describing your image
|
||||
|
||||
See `fedora-42-base.toml` for an example.
|
||||
|
||||
2. Push the toml to composer
|
||||
|
||||
```bash
|
||||
composer-cli blueprints push active/software_osbuild/fedora-42-base.toml
|
||||
|
||||
# List blueprints
|
||||
composer-cli blueprints list
|
||||
```
|
||||
|
||||
3. Generate the image
|
||||
|
||||
```bash
|
||||
# List image types
|
||||
composer-cli compose types
|
||||
|
||||
# Build the image
|
||||
composer-cli compose start fedora-42-base qcow2
|
||||
|
||||
# Check status
|
||||
composer-cli compose status
|
||||
```
|
||||
|
||||
4. Run the image
|
||||
|
||||
```bash
|
||||
# Download the image
|
||||
composer-cli compose image --filename ~/Downloads/fedora-42-base.qcow2 image-uuid
|
||||
|
||||
# Test with qemu
|
||||
qemu-kvm --name test-fedora-42-base -m 4096 -hda ~/Downloads/fedora-42-base.qcow2
|
||||
```
|
||||
Reference in New Issue
Block a user