packer_configure(
packer_version = "1.8.6",
qemu_version = "wip", # TODO: is it possible to load our own qemu like this?
global_substitutions = {
'{headless}': "true",
'{http_dir}': ".",
'{accel}': "kvm",
'{vga}': "qxl",
'{display}': "none",
'{cpu}': "Cascadelake-Server-v4" # NOTE: change this to whatever your virtualization target is
},
debug = True
)
packer_configure(
packer_version = "1.8.6",
qemu_version = "wip", # TODO: is it possible to load our own qemu like this?
global_substitutions = {
'{http_dir}': ".",
'{accel}': "tcg", # TODO: confirm hvm works here
'{vga}': "cirrus",
'{display}': "cocoa",
'{cpu}': "Cascadelake-Server-v4"
},
debug = True # This enables better errors in packer, but is not needed (PACKER_LOG=1)
)
As of now, this doesn’t seem to work
using cocoa
and cirrus
for the qemuargs
’s display
and vga
arguments appears to let this work on MacOS
github action to publish this needs to be set up in order for the usual http_archive
bazel installation to work
load("@com_github_rules_packer//:packer_config.bzl", "packer_configure")
packer_configure(
packer_version = "1.8.6",
qemu_version = "wip", # TODO: is it possible to load our own qemu like this?
global_substitutions = {
'"{$foo}"': "bar",
'{http_dir}': ".",
'{accel}': "kvm",
'{vga}': "qxl",
'{display}': "gtk",
'{cpu}': "Cascadelake-Server-v4"
},
debug = True
)
load("@com_github_rules_packer//:packer_dependencies.bzl", "packer_dependencies")
packer_dependencies()
load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
aspect_bazel_lib_dependencies()
There are several special variables and facilities for getting the packer experience to be more ergonomic
interpolation | meaning | where |
---|---|---|
$(location depfile) | any file in deps can be accessed this way | in substitutions or vars or env |
$(location output) | the output directory (packer’s output_directory ) | in substitutions or vars |
{iso_sha} | ||
{input_img} | the target path of the input_img argument | in substitutions or vars or env |
{iso} | the substitution of the input_img | in your packerfile or varfile |