diskimage-builder is the golden disk image builder used by OpenStack for creating disk images. It provides a set of tools and elements to build customizable operating system images. Current version is 3.41.0, with a stable release cadence. Requires Python >=3.8.
pip install diskimage-builderVerified import paths — ran on the pinned version, not inferred.
Build a basic Ubuntu disk image using disk-image-create script. Set ELEMENTS_PATH to include custom elements if needed.
Ensure all elements are Python 3 compatible, or pin to version 1.x if legacy support needed.
Run commands with sudo or configure user namespace support in your environment.
Switch to defining dependencies in element.yaml files or using DIB_REQUIRE_ELEMENTS.
Always test images in a VM and check DIB_DEBUG_TRACE=1 for verbosity.
Install via 'pip install diskimage-builder' and ensure Python Scripts directory is in PATH (e.g., ~/.local/bin).
Run 'pip install pyyaml' or 'pip install diskimage-builder[pyyaml]'.
Prepend 'sudo' or run as root user. Alternatively, use --no-tmpfs and ensure user has loop device access.