No description
Find a file
Michael Vogt e9e8dc5256 filters: add new getOneImage() helper for manifest/build
This commit adds a helper to find exactly a single image from a
given disto/type/arch description. This will be used in `manifest`,
`build` and potentially more. It is meant to support copy/paste
from the `image-builder list-images` output, so: "distro:centos-9"
is support just like "centos-9" (same for distro/imgType/arch).
2024-12-16 07:54:45 +00:00
.github/workflows workflow: update to work with the images dependencies 2024-11-28 09:53:08 +00:00
cmd/image-builder filters: add new getOneImage() helper for manifest/build 2024-12-16 07:54:45 +00:00
go.mod go.mod: upgrade golang.org/x/crypto 2024-12-12 18:48:50 +00:00
go.sum go.mod: upgrade golang.org/x/crypto 2024-12-12 18:48:50 +00:00
README.md README: document install, prerequists and list-images 2024-11-29 10:52:28 +00:00

image-builder CLI

Build images from the commandline in a convenient way.

Installation

This project is under development right now and needs to be run via:

$ go run github.com/osbuild/image-builder-cli/cmd/image-builder@main

or install it into $GOPATH/bin

$ go install github.com/osbuild/image-builder-cli/cmd/image-builder@main

we plan to provide rpm packages as well.

Prerequisites

Make sure to have the required osbuild rpms installed:

$ sudo dnf install osbuild osbuild-depsolve-dnf osbuild-composer

(osbuild-composer is only needed to get the repository definitions and this dependency will go away soon).

Example

To see the list of buildable images run:

$ image-builder list-images
...
centos-9 type:qcow2 arch:x86_64
...
rhel-10.0 type:ami arch:x86_64
...

It is possible to filter:

$ image-builder list-images --filter ami
...
centos-9 type:ami arch:x86_64
...
rhel-8.5 type:ami arch:aarch64
...
rhel-10.0 type:ami arch:aarch64

or be more specific

$ image-builder list-images --filter "arch:x86*" --filter "distro:*centos*"
centos-9 type:ami arch:x86_64
...
centos-9 type:qcow2 arch:x86_64
...

The following filters are currently supported, shell-style globbing is supported:

  • distro: the distro name (e.g. fedora-41)
  • arch: the architecture name (e.g. x86_64)
  • type: the image type name (e.g. qcow2)
  • bootmode: the bootmode (legacy, uefi, hybrid)

The output can also be switched, supported are "text", "json":

$ image-builder list-images --output=json
[
  {
    "distro": {
      "name": "centos-9"
    },
    "arch": {
      "name": "aarch64"
    },
    "image_type": {
      "name": "ami"
    }
  },
...
  {
    "distro": {
      "name": "rhel-10.0"
    },
    "arch": {
      "name": "x86_64"
    },
    "image_type": {
      "name": "wsl"
    }
  }
]

FAQ

Q: Does this require a backend. A: The osbuild binary is used to actually build the images but beyond that no setup is required, i.e. no daemons like osbuild-composer.