Packer QEMU image builder for CoreOS's Container Linux
A basic Packer template, Makefile and cloud config file to get started building QEMU images for CoreOS Container Linux.
$ git clone https://github.com/dyson/packer-qemu-coreos-container-linux.git .
$ cd packer-qemu-coreos-container-linux
$ cp container-linux-config.yml.example container-linux-config.yml
CoreOS Container Linux is moving away from the cloud-config file format and over to the container linux config and ignition formats. Ignition files use JSON and are transpiled from a container linux config YAML file. The ct tool is used to do this and the Makefile includes some convenient targets to install, update, and delete this tool for linux hosts. Requires root to install the binary into /usr/local/bin. If you already have ct installed you can skip these steps.
Install:
$ make ct
Update:
$ make ct-update
Delete:
$ make ct-clean
Populate your container linux config YAML file with all configuration you want apply in the installed image.
PACKER_CMD ?= packer
RELEASE ?= alpha
DIGEST_URL ?= https://$(RELEASE).release.core-os.net/amd64-usr/current/coreos_production_iso_image.iso.DIGESTS
CONFIG ?= container-linux-config.yml
DISK_SIZE ?= 40000
MEMORY ?= 2048M
BOOT_WAIT ?= 45s
$ make container-linux
$ make container-linux RELEASE=alpha
Delete builds:
$ make clean
Delete the packer cache (making packer download the latest iso image on next build):
$ make cache-clean
Without buidling from the Makefile you will neet to obtain the iso checksum manually (or not varify it) and also transpile the container linux config into the ignition format before building.
"release": "stable",
"iso_checksum": "",
"iso_checksum_type": "none",
"disk_size": "40000",
"memory": "2048M",
"boot_wait": "45s",
"ignition": "ignition.json"
$ packer build -force container-linux.json
$ packer build -force -var 'release=alpha' container-linux.json
See LICENSE file.