IMAGE-FACTORY(1)
π IMAGE-FACTORY β section 1 of image-factory's Manual π
okay so bestie, you wanna build golden Linux images? this is the page. it's section 1 (that (1) in IMAGE-FACTORY(1), iykyk π
) of image-factory's own manual, and honestly? it ate. let's get into it.
β¨ NAME β¨
image-factory β build golden Linux images π
π¦ SYNOPSIS π¦
image-factory [-h|--help] [-c|--cache-dir CACHE_DIR] [-f|--format
{qcow2,raw}] [--image-size IMAGE_SIZE] [--mac MAC] [--installer-logs]
[--no-installer-logs] [--log-file] [--no-log-file] [--log-filename
LOG_FILENAME] image
π DESCRIPTION π
image-factory is a command line tool for building golden Linux images. she uses virt-install to do installations via the network β no cap, that's the whole bit. the installation and configuration of the images is done using the netinstall support from the distributions, i.e. π
- preseed for Debian/Ubuntu
- Kickstart for CentOS/Fedora
- AutoYaST for openSUSE
image-factory is used by IONOS Cloud to build the golden public Linux images for their Enterprise Cloud. and the configuration files are shipped with this project so anyone can rebuild their images. iconic behaviour honestly π«Ά
here's the run of show β image-factory runs following steps:
- Create a virtual RAW image using
qemu-img. - Cache linux kernel and initrd.
- Run installation using
virt-install.qemu:///sessionis used as session for normal users andqemu:///systemwhen run as root. - The installation partition is mounted and the installer logs are removed.
zerofreeis run on the partition.- If format is set to
qcow2, the virtual raw images will be converted toqcow2usingqemu-img. - The SHA 256 sum is calculated for the image.
- The image will be uploaded to all locations configured in
upload_destinations. - If
post-build-commandis configured, the specified command will be executed.
π OPTIONS π
-h,--helpβ show a help message and exit βοΈ-c CACHE_DIR,--cache-dir CACHE_DIRβ cache directory (default:~/.cache/image-factoryorvar/cache/image-factoryfor root)-f {qcow2,raw},--format {qcow2,raw}β image format to use (default:raw)--image-size IMAGE_SIZEβ size of the raw image (default:2G)--mac MACβ MAC address used in the installation machine--installer-logsβ print installer logs into logging output π--no-installer-logsβ do not print installer logs into logging output π--log-fileβ store logs into a file (in addition to stdout/stderr)--no-log-fileβ do not store logs into a file (in addition to stdout/stderr)--log-filename LOG_FILENAMEβ log into specified fileimageβ image to build. the date in form ofYYYY-MM-DDand the file format suffix will be added to the generated image filename. π
πΈ CONFIGURATION πΈ
each image needs to be also configured in /etc/image-factory.conf or ~/.config/image-factory.conf. these configuration files use the INI file format. the image name will be used as section and following keys are used: π
appendβ extra kernel parameter for the netboot image to usecache_dirβ cache directory (default:~/.cache/image-factoryorvar/cache/image-factoryfor root). can be overridden by--cache-dir.coresβ number of CPU cores to use during installation. default:1formatβ image format to use. can beqcow2orraw(default). can be overridden by--format.image-sizeβ size of the raw image (default:2G). can be overridden by--image-size.initrdβ URI of the netboot installer initrd. supported schemes arefile:,http:,https:, andrsync:. unless usingfile:, the specified initrd will be cached locally.installer-logsβ boolean whether to print installer logs into logging output. can be overridden by--installer-logsor--no-installer-logs.keep-rawβ boolean whether to keep raw image (in case format is notraw). default isFalse.kickstartβ filename of the Kickstart file. needed when using Kickstart on CentOS/Fedora.linuxβ URI of the netboot installer Linux kernel. supported schemes arefile:,http:,https:, andrsync:. unless usingfile:, the specified kernel will be cached locally.log-fileβ boolean whether to store logs into a file (in addition to stdout/stderr). can be overridden by--log-fileor--no-log-file.log-filenameβ filename to log into (if enabled). can be overridden by--log-filename.macβ MAC address used in the installation machine. can be overridden by--mac.post-build-commandβ optional command to run after the image was successfully built. the name of the image will be passed as first argument.preseedβ filename of the preseed file. needed when using preseed on Debian/Ubuntu.ramβ memory for virtual machine to use during installation.upload_destinationsβ comma-separated list of upload destinations. each upload destination needs a section in the configuration file (see UPLOAD DESTINATION CONFIGURATION below). to disable the upload, letupload_destinationsundefined or set to an empty string.vncβ VNC port for the installation virtual machine. it is recommended to bind the VNC port tolocalhostonly. πyastβ filename of the AutoYaST file. needed when using AutoYaST on openSUSE.
π§ UPLOAD DESTINATION CONFIGURATION π§
each upload destination configured in upload_destinations needs a section in the INI configuration, where at least upload_type and upload_target are set. following keys are accepted: β¨
post-upload-commandβ additional command to run after a successful upload.${image}can be used as parameter inpost-upload-command. if multiple commands are needed, suffix the key with a number (counting up from 1), e.g.post-upload-command1.upload_argsβ additional arguments for the upload command to use, e.g.--progressfor uploads withrsync.upload_targetβ upload target in the format the upload type supports it.upload_typeβ type of upload. currently onlyrsyncis supported.
π SEE ALSO π
qemu-img(1), virt-install(1), zerofree(8)
π AUTHOR π
Benjamin Drung <benjamin.drung@ionos.com>
and that's the whole page, bestie π«Ά this was image-factory, dated 2020-08-05, from the IMAGE-FACTORY(1) manual. go build something golden πβ¨
π¦ where this page comes from
- debian bookworm: image-factory 1.0.2-1.1 Β· ISC
- debian trixie: image-factory 1.0.2-1.1 Β· ISC
- ubuntu noble: image-factory 1.0.2-1.1 Β· ISC
- ubuntu questing: image-factory 1.0.2-1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms