Blueprint Reference
Blueprints are text files in the TOML format that describe customizations for the image you are building. To be used in the π΅Β onΒ premises environment.
Analogously the request content of the
image-builder /compose
request
describes customizations of an image the π€Β hosted service should be building.
Not all customizations are supported in the API but those existing, are highlighted here with a
π€Β hosted label.
Additionally, there is π£Β bootc which is supposed to be used from within podman desktop.
An important thing to note is that these customizations are not applicable to all image types.
osbuild-composer
currently has no good validation or warning system in place to tell you if a customization in your blueprint is not supported for the image type you're building. The customization may be silently dropped.
A very basic blueprint with just the required attributes at the root looks like:
- π΅ on premises
- π€ hosted
- βͺ bootc
name = "basic-example"
description = "A basic blueprint"
version = "0.0.1"
{
"image_name": "basic-example",
"image_description": "A basic blueprint"
}
βΉοΈ - Currently not supported
Where:
- The
name
attribute is a string that contains the name of the blueprint. It can contain spaces, but they will be converted to-
when it is imported intoosbuild-composer
. It should be short and descriptive. - The
description
attribute is a string that can be a longer description of the blueprint and is only used for display purposes. - The
version
attribute is a string that contains a semantic versioning compatible version number. If a new blueprint is uploaded with the same version the server will automatically bump the PATCH level of the version. If the version doesn't match it will be used as is. For example, uploading a blueprint with version set to 0.1.0 when the existing blueprint version is 0.0.1 will result in the new blueprint being stored as version 0.1.0.
You can upload a blueprint with the osbuild-composer blueprints push $filename
command, the blueprint will then be usable in osbuild-composer compose
as the name
you gave it.
Blueprints have two main sections, the content and customizations sections.
Distribution selection with blueprints π΅Β π€β
The blueprint now supports a new distro
field that will be used to select the
distribution to use when composing images, or depsolving the blueprint. If
distro
is left blank it will use the host distribution. If you upgrade the
host operating system the blueprints with no distro
set will build using the
new os. You can't build an OS image that differs from the host OS that Image Builder lives on.
eg. A blueprint that will always build a Fedora 38 image, no matter what version is running on the host:
Note that osbuild-composer prior to version 100 didn't use a dot .
to separate major and minor release versions in the distro name. New versions are backward compatible, so they will still accept the old distro names of distributions supported up to the version 100. However, going forward, it is strongly advised to use the new naming scheme. Future distribution versions won't be backward compatible (e.g. rhel-100
won't work in the future for RHEL 10.0, but one will have to use rhel-10.0
).
- π΅ on premises
- π€ hosted
- βͺ bootc
name = "tmux"
description = "tmux image with openssh"
version = "1.2.16"
distro = "fedora-38"
[[packages]]
name = "tmux"
version = "*"
[[packages]]
name = "openssh-server"
version = "*"
name = "tmux"
description = "tmux image with openssh"
version = "1.2.16"
# for osbuild-composer version < 100
# distro = "rhel-84"
distro = "rhel-8.4"
[[packages]]
name = "tmux"
version = "*"
[[packages]]
name = "openssh-server"
version = "*"
{
"image_name": "tmux",
"image_description": "tmux image with openssh",
"distribution": "fedora-38",
"customizations": {
"packages": ["tmux", "openssh-server"]
}
}
{
"image_name": "tmux",
"image_description": "tmux image with openssh",
"distribution": "rhel-8.4",
"customizations": {
"packages": ["tmux", "openssh-server"]
}
}
βΉοΈ - Currently not supported
Contentβ
The content section determines what goes into the image from other sources such as packages, package groups, or containers. Content is defined at the root of the blueprint.
Packages π΅Β π€β
The packages
and modules
lists contain objects with a name
and optional version
attribute.
- The
name
attribute is a required string and can be an exact match, or a filesystem-like glob using*
for wildcards and?
for character matching. - The
version
attribute is an optional string can be an exact match or a filesystem-like glob of the version using*
for wildcards and?
for character matching. If not provided the latest version in the repositories is used.
Currently there are no differences between packages and modules in osbuild-composer
. Both are treated like an rpm package dependency.
When using virtual
provides
as the package name the version glob should be*
. And be aware that you will be unable tofreeze
the blueprint. This is because theprovides
will expand into multiple packages with their own names and versions.
For example, to install tmux-2.9a
and openssh-server-8.*
packages, add this to your blueprint:
- π΅ on premises
- π€ hosted
- βͺ bootc
[[packages]]
name = "tmux"
version = "2.9a"
[[packages]]
name = "openssh-server"
version = "8.*"
Or in alternative syntax1:
packages = [
{ name = "tmux", version = "2.9a" },
{ name = "openssh-server", version = "8.*" }
]
{
"customizations": {
"packages": ["tmux", "openssh-server"]
}
}
βΉοΈ - Currently not supported
Groups π΅Β π€β
The groups
list contains objects with a name
-attribute.
- The
name
attribute is a required string and must match the id of a package group in the repositories exactly.
groups
describes groups of packages to be installed into the image. Package groups are defined in the repository metadata. Each group has a descriptive name used primarily for display in user interfaces and an ID more commonly used in kickstart files. Here, the ID is the expected way of listing a group. Groups have three different ways of categorizing their packages: mandatory, default, and optional. For the purposes of blueprints, only mandatory and default packages will be installed. There is no mechanism for selecting optional packages.
For example, if you want to install the anaconda-tools
group, add the following to your blueprint:
- π΅ on premises
- π€ hosted
- βͺ bootc
{
"customizations": {
"packages": ["@anaconda-tools"],
}
}
βΉοΈ - Currently not supported
Containers π΅ π€β
The containers
list contains objects with a source
and optional tls-verify
attribute.
These list entries describe the container images to be embedded into the image.
- The
source
attribute is a required string and is a reference to a container image at a registry. - The
name
attribute is an optional string to set the name under which the container image will be saved in the image. If not specifiedname
falls back to the same value assource
. - The
tls-verify
attribute is an optional boolean to disable TLS verification of the source download. By default this is set totrue
. - The
local-storage
attribute is an optional boolean to pull the container image from the host's local-storage. By default this is set tofalse
.
The container is pulled during the image build and stored in the image at the default local container storage location that is appropriate for the image type, so that all supported container tools like podman
and cri-o
will be able to work with it.
The embedded containers are not started, to do so you can create systemd unit files or quadlets with the files customization.
Container images from local-storage are only supported on-premise.
To embed the latest fedora container from http://quay.io and a container from your host, add this to your blueprint:
- π΅ on premises
- π€ hosted
- βͺ bootc
[[containers]]
source = "quay.io/fedora/fedora:latest"
[[containers]]
source = "localhost/test:latest"
local-storage = true
Or in alternative syntax1:
containers = [
{ source = "quay.io/fedora/fedora:latest" },
{ source = "quay.io/fedora/fedora-minimal:latest", tls-verify = false, name = "fedora-m" },
{ source = "localhost/test:latest", local-storage = true },
]
{
"customizations": {
"containers": [
{ "source": "quay.io/fedora/fedora:latest" },
{ "source": "quay.io/fedora/fedora-minimal:latest",
"tls_verify": false,
"name": "fedora-m"
}
]
}
}
βΉοΈ - Currently not supported
To access protected container resources a containers-auth.json(5)
file can be used, see Container registry credentials.
Customizationsβ
In the customizations we determine what goes into the image that's not in the default packages defined under Content.
Hostname π΅ π€β
customizations.hostname
is an optional string that can be used to configure the hostname of the final image:
- π΅ on premises
- π€ hosted
- βͺ bootc
[customizations]
hostname = "baseimage"
{
"customizations": {
"hostname": "baseimage"
}
}
βΉοΈ - Currently not supported
This is optional and can be left out to use the default hostname.
Kernel π΅ π€ π£β
Kernel Command-Line Argumentsβ
An optional object that contains the following attributes:
name
an optional string which kernel to useappend
an optional string to append arguments to the bootloader kernel command line
- π΅ on premises
- π€ hosted
- π£ bootc
[customizations.kernel]
name = "kernel-debug"
append = "nosmt=force"
{
"customizations": {
"kernel": {
"name": "kernel-debug",
"append": "nosmt=force"
}
}
}
[customizations.kernel]
# name - not yet supported
append = "nosmt=force"
Subscription-manager (RHSM) π΅β
An optional set of configuration options for the Red Hat Subscription Manager (RHSM) client.
The customization expects that subscription-manager
package is installed in the image, which is by default part of the RHEL distribution bootable images. To explicitly install the package, add it to the packages section in the blueprint.
The customization is not supported on Fedora distribution images.
To configure RHSM in the final image:
- π΅ on premises
- βͺ hosted
- βͺ bootc
[customizations.rhsm.config.dnf_plugins.product_id]
enabled = true
[customizations.rhsm.config.dnf_plugins.subscription_manager]
enabled = true
[customizations.rhsm.config.subscription_manager.rhsm]
manage_repos = true
[customizations.rhsm.config.subscription_manager.rhsmcertd]
auto_registration = true
βΉοΈ - Currently not supported
βΉοΈ - Currently not supported
RPM configuration π΅β
An optional set of RPM configuration options. Currently, only importing RPM GPG keys from a file in the image is supported.
files
is a list of strings containing the paths to the GPG keys to import. The files must be present in the image.
To configure RPM in the final image:
- π΅ on premises
- βͺ hosted
- βͺ bootc
[customizations.rpm.import_keys]
files = [
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-18-primary",
"/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-19-primary"
]
βΉοΈ - Currently not supported
βΉοΈ - Currently not supported
SSH Keys π΅ π€β
An optional list of objects containing:
- The
user
attribute is a required string and must match the name of a user in the image exactly. - The
key
attribute is a required string that contains the public key to be set for that user.
Warning: key
expects the entire content of the public key file, traditionally ~/.ssh/id_rsa.pub
but any algorithm supported by the operating system in the image is valid
Note: If you are adding a user you can add their SSH key in the additional users customization instead.
Set an existing user's SSH key in the final image:
- π΅ on premises
- π€ hosted
- βͺ bootc
[[customizations.sshkey]]
user = "root"
key = "PUBLIC SSH KEY"
{
"customizations": {
"users": [
{ "name": "root",
"ssh_key": "PUBLIC SSH KEY"
}
]
}
}
βΉοΈ - Currently not supported
The key will be added to the user's authorized_keys
file in their home directory.
Additional Users π΅ π€ π£β
An optional list of objects that contain the following attributes:
name
a required string that sets the username.description
an optional string.password
an optional string.key
an optional string.home
an optional string.shell
an optional string.groups
an optional list of strings.uid
an optional integer.gid
an optional integer.expiredate
an optional integer.
Warning: key
expects the entire content of the public key file, traditionally ~/.ssh/id_rsa.pub
but any algorithm supported by the operating system in the image is valid
Note: If the password starts with $6$, $5$, or $2b$ it will be stored as an encrypted password. Otherwise it will be treated as a plain text password.
To generate an encrypted password you might want to use openssl
:
openssl passwd -6
or mkpasswd
mkpasswd -m sha-512
Add a user to the image, and/or set their ssh key. All fields for this section are optional except for the name. The following is a complete example:
- π΅ on premises
- π€ hosted
- π£ bootc
[[customizations.user]]
name = "admin"
description = "Administrator account"
password = "$6$CHO2$3rN8eviE2t50lmVyBYihTgVRHcaecmeCk31L..."
key = "PUBLIC SSH KEY"
home = "/srv/widget/"
shell = "/usr/bin/bash"
groups = ["widget", "users", "wheel"]
uid = 1200
gid = 1200
expiredate = 12345
{
"customizations": {
"users": [
{ "name": "admin",
"ssh_key": "PUBLIC SSH KEY"
}
],
"groups": [
{ "name": "admin",
"gid": 1200
}
]
}
}
[[customizations.user]]
name = "alice"
password = "bob"
key = "ssh-rsa AAA ... user@email.com"
groups = ["wheel"]
Additional groups π΅ π€ π£β
An optional list of objects that contain the following attributes:
name
a required string that sets the name of the group.gid
a required integer that sets the id of the group.
- π΅ on premises
- π€ hosted
- π£ bootc
[[customizations.group]]
name = "widget"
gid = 1130
{
"customizations": {
"groups": [
{ "name": "widget",
"gid": 1130
}
]
}
}
[[customizations.group]]
name = "widget"
gid = 1130