No description
Find a file
Michael Vogt 4f1816c1b7 manifestgen: pass missing repoConfig to preManifest.Serialize()
When depsolve is run it returns a list of packageSpecs and the
matching repository config. This repo config is different/distinct
from the repository config that is passed into depsolve via the
package sets or the repositories that are loaded via the
reporegistry and needs to be passed into `manifest.Serialize()`.

The key different is that the depsovle `repoConfig` contains
the repo.Id that match the packageSpec.RepoId. With those two
matching IDs we can use librepo (see osbuild PR#1974) to infere
what mirror to use for what package.

This commit now passes the correct repoConfig into
preManifest.Serialize() now.

No test (sorry!) as this is really hard to test in isolation, there
is nothing observable today from repoConfig and it is impossible
to add a "witness" pipelien that could check that the right argument
is passed in `pipeline.serializeStart()`. So until we refactor
images you will have to take my word for this (sorry again).
2025-01-10 13:49:28 +00:00
.github workflow: switch to composite action to fix go/pytest 2025-01-10 08:30:28 +00:00
cmd/image-builder cmd: drop TestListImagesOverrideDatadir 2025-01-10 08:30:28 +00:00
internal manifestgen: pass missing repoConfig to preManifest.Serialize() 2025-01-10 13:49:28 +00:00
test test: fix integration test 2025-01-10 08:30:28 +00:00
tools pre-commit: introduce make lint 2025-01-07 12:29:58 +00:00
.gitignore prepare all syntax for linters and spellchecks 2025-01-07 12:29:58 +00:00
.golangci.yml pre-commit: introduce make lint 2025-01-07 12:29:58 +00:00
.packit.yaml prepare all syntax for linters and spellchecks 2025-01-07 12:29:58 +00:00
.pre-commit-config.yaml pre-commit: drop golangci-lint for now 2025-01-10 08:30:28 +00:00
.pylintrc pre-commit: introduce make lint 2025-01-07 12:29:58 +00:00
.spellcheck-en-custom.txt lint: fix whitespace/spelling in README 2025-01-10 08:30:28 +00:00
.spellcheck.yml pre-commit: introduce make lint 2025-01-07 12:29:58 +00:00
.yamllint pre-commit: introduce make lint 2025-01-07 12:29:58 +00:00
Containerfile repos: lookup <buildin>, /{etc,usr/share}/image-builder/repositories 2025-01-09 16:17:50 +00:00
entrypoint.sh ibcli: use /var/cache/image-builder/store as default for --store 2024-12-19 11:35:15 +00:00
go.mod go.sum: update to latest images lib to get embeded repos 2025-01-09 16:17:50 +00:00
go.sum go.sum: update to latest images lib to get embeded repos 2025-01-09 16:17:50 +00:00
HACKING.md prepare all syntax for linters and spellchecks 2025-01-07 12:29:58 +00:00
image-builder-cli.spec Post release version bump 2025-01-08 08:29:09 +00:00
LICENSE chore: LICENSE 2024-12-16 09:13:44 +00:00
Makefile Makefile: fix packer version by using git tag 2025-01-10 11:55:52 +00:00
README.md lint: fix whitespace/spelling in README 2025-01-10 08:30:28 +00:00
setup.cfg pre-commit: introduce make lint 2025-01-07 12:29:58 +00:00

image-builder CLI

Build images from the command line in a convenient way.

Run via container

$ sudo podman run --privileged \
   -v ./output:/output \
   ghcr.io/osbuild/image-builder-cli:latest \
   build \
   --distro fedora-41 \
   minimal-raw

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

Examples

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
...

To actually build an image run:

$ sudo image-builder build qcow2 --distro centos-9
...

this will create a directory centos-9-qcow2-x86_64 under which the output is stored.

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.

Q: Can I have custom repository files? A: Sure! The repositories are encoded in json in "-.json", files, e.g. "fedora-41.json". See these examples. Use the "--datadir" switch and place them under "repositories/name-version.json", e.g. for: "--datadir /my-project --distro foo-1" a json file must be put under "/my-project/repositories/foo-1.json.

Project

Repository