4.3. Supported image customizations for a configuration file
You can use a build configuration file in the TOML or JSON format to add customizations for your resulting disk image.
The container directory maps the config file to /config.toml. The customizations object defines the image modifications. Additionally, you can embed a build configuration file, either as config.json or config.toml in the /usr/lib/bootc-image-builder directory. The system automatically uses any file system or disk customizations found in this directory by default. This behavior can be overridden if you explicitly specify a different customization.
For the JSON format, you can also pass the configuration by using stdin when you use the --config argument.
- User customization
Add a user to your disk image, and optionally set an SSH key. All fields for this section are optional except for the
name.Expand TOML JSON [[customizations.user]] name = "user" password = "password" key = "ssh-rsa AAA ... user@email.com" groups = ["wheel"]{ "customizations": { "user": [ { "name": "user", "password": "password", "key": "ssh-rsa AAA ... user@email.com", "groups": [ "wheel", "admins" ] } ] } }- Kernel configuration
You can customize the kernel boot parameters in the configuration file.
Expand TOML JSON [customizations.kernel] name = "kernel-debug" append = "nosmt=force"{ "customizations": { "kernel": { "append": "mitigations=auto,nosmt" } } }- File systems configuration
You can use the file system section of the customizations to set the minimum size of the base partitions, such as
/and/boot, and to create extra partitions with mount points under/var.Expand TOML JSON [[customizations.filesystem]] mountpoint = "/" minsize = "10 GiB" [[customizations.filesystem]] mountpoint = "/var/data" minsize = "20 GiB"{ "customizations": { "filesystem": [ { "mountpoint": "/", "minsize": "10 GiB" }, { "mountpoint": "/var/data", "minsize": "20 GiB" } ] } }- File system type interaction with rootfs
The root file system type (
--rootfs) argument overrides the default value from the source container. It also sets the file system types for all additional mount points for theext4,xfs, andbtrfstypes.For supported mount points and sizes, the following restrictions and rules apply, unless the
rootfsisbtrfs:-
You can specify
/to set the minimum size of the root file system. The final size of the file system, mounted at/sysrooton a booted system, equals the value you specify in this configuration or 2x the size of the base container, whichever is larger. -
You can specify
/bootto set the minimum size of the boot partition. You can also specify subdirectories of/var, but you cannot specify symlinks in/var. For example,/var/homeand/var/runare symlinks and cannot be file systems on their own. -
/varitself cannot be a mount point. Therootfsoption defines the file system type for the root file system. -
Currently, there is no support for creating
btrfssubvolumes during build time. Therefore, if therootfsisbtrfs, no custom mount points are supported under/var. You can only configure/and/boot.
-
You can specify
- Anaconda ISO (installer) configuration options
Create a Kickstart file that contains the installation commands of your choice. Then, add a Kickstart file to your ISO build to create a fully customized and automated installation medium.
注意The following combined customizations are not supported:
[customizations.user]and[customizations.installer.kickstart]. When you add a Kickstart, use a configuration file in theTOMLformat, because multi-line strings are prone to error.Expand TOML JSON [customizations.installer.kickstart] contents = """ text --non-interactive zerombr clearpart --all --initlabel --disklabel=gpt autopart --noswap --type=lvm network --bootproto=dhcp --device=link --activate --onboot=on """{ "customizations": { "installer": { "kickstart": { "contents": "text --non-interactive\nzerombr\nclearpart --all --initlabel --disklabel=gpt\nautopart --noswap --type=lvm\nnetwork --bootproto=dhcp --device=link --activate --onboot=on" } } } }警告bootc-image-builderdoes not add additional Kickstart commands besides the container image, which the system adds automatically to the container image. See Creating Kickstart files for more information.