doc: initial documentation

Supply initial documentation for `image-builder`. This documentation
will be imported into the osbuild [1] website.

[1]: https://osbuild.org/

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
This commit is contained in:
Simon de Vlieger 2024-12-20 09:12:37 +01:00
parent c590c38d4f
commit 2455b9d586
6 changed files with 154 additions and 5 deletions

56
doc/01-usage.md Normal file
View file

@ -0,0 +1,56 @@
# Usage
After [installation](./00-installation.md) you probably want to use `image-builder`. A general workflow would be to find the image type you want to build and then build it.
Let's take a look at the available `x86_64` image types for Fedora 41 and build one of them.
```console
$ image-builder list-images --filter arch:x86_64 --filter distro:fedora-41
fedora-41 type:ami arch:x86_64
fedora-41 type:container arch:x86_64
fedora-41 type:image-installer arch:x86_64
fedora-41 type:iot-bootable-container arch:x86_64
fedora-41 type:iot-commit arch:x86_64
fedora-41 type:iot-container arch:x86_64
fedora-41 type:iot-installer arch:x86_64
fedora-41 type:iot-qcow2-image arch:x86_64
fedora-41 type:iot-raw-image arch:x86_64
fedora-41 type:iot-simplified-installer arch:x86_64
fedora-41 type:live-installer arch:x86_64
fedora-41 type:minimal-raw arch:x86_64
fedora-41 type:oci arch:x86_64
fedora-41 type:openstack arch:x86_64
fedora-41 type:ova arch:x86_64
fedora-41 type:qcow2 arch:x86_64
fedora-41 type:vhd arch:x86_64
fedora-41 type:vmdk arch:x86_64
fedora-41 type:wsl arch:x86_64
$ image-builder build --distro fedora-41 qcow2
# ...
```
# Blueprints
Images can be customized with [blueprints](https://osbuild.org/docs/user-guide/blueprint-reference). For example we could build the `qcow2` we built above with some customizations applied.
We'll be adding the `nginx`, and `haproxy` packages and enabling their services so they start on boot. We'll also add a user by the name `user` with an ssh key and set the hostname of the machine:
```console
$ cat blueprint.toml
packages = [
{ name = "nginx" },
{ name = "haproxy" },
]
[customizations]
hostname = "mynewmachine.home.arpa"
[customizations.services]
enabled = ["nginx", "haproxy"]
[[customizations.user]]
name = "user"
key = "ssh-ed25519 AAAAC..."
$ sudo image-builder build --blueprint blueprint.toml --distro fedora-41 qcow2
# ...
```