backticks, spaces, commas In general, a list of items should have a space after each comma. While there are editorial styles that suggest commas inside quotations, they're horrible advice when the backticks are describing specific character for a user to enter. one off indent filters section singular backticks... word wrap long lines... spelling: macOS contributing: clarify closing case contributing: link to changelog contributing: point to git remote... contributing: split commands from descriptions contributing: grammar spelling: github grammar: comma after etc. spelling: macOS grammar: i.e. alicloud: use relative link alicloud: use backticks alicloud: bits alicloud: such as grammar: comma after etc. avoid linking periods grammar: period amazon-chroot: IOPS amazon-chroot: use backticks amazon-chroot: link to section amazon-chroot: whether-or-not; period amazon-ebs: period amazon-ebs: use relative link amazon-ebs: use backticks amazon-ebs: comma amazon-ebs: bold amazon-ebssurrogate: comma after etc. amazon-ebssurrogate: this builder amazon-instance: this builder amazon-ebssurrogate: set this amazon-ebssurrogate: whether-or-not amazon-ebssurrogate: period amazon-ebssurrogate: bold section reference amazon-ebssurrogate: backticks... amazon-ebssurrogate: commas around e.g. spelling: precedence spelling: i.e. amazon-ebssurrogate: backticks...
2.2 KiB
description: |
The lxd Packer builder builds containers for LXD. The builder starts an LXD
container, runs provisioners within this container, then saves the container
as an LXD image.
layout: docs
page_title: 'LXD - Builders'
sidebar_current: 'docs-builders-lxd'
...
LXD Builder
Type: lxd
The lxd Packer builder builds containers for LXD. The builder starts an LXD
container, runs provisioners within this container, then saves the container
as an LXD image.
The LXD builder requires a modern linux kernel and the lxd package.
This builder does not work with LXC.
Basic Example
Below is a fully functioning example.
{
"builders": [
{
"type": "lxd",
"name": "lxd-xenial",
"image": "ubuntu-daily:xenial",
"output_image": "ubuntu-xenial",
"publish_properties": {
"description": "Trivial repackage with Packer"
}
}
]
}
Configuration Reference
Required:
-
image(string) - The source image to use when creating the build container. This can be a (local or remote) image (name or fingerprint). E.G.my-base-image,ubuntu-daily:x,08fababf6f27, ...~> Note: The builder may appear to pause if required to download a remote image, as they are usually 100-200MB.
/var/log/lxd/lxd.logwill mention starting such downloads.
Optional:
-
init_sleep(string) - The number of seconds to sleep between launching the LXD instance and provisioning it; defaults to 3 seconds. -
name(string) - The name of the started container. Defaults topacker-$PACKER_BUILD_NAME. -
output_image(string) - The name of the output artifact. Defaults toname. -
command_wrapper(string) - Lets you prefix all builder commands, such as withsshfor a remote build host. Defaults to"". -
publish_properties(map[string]string) - Pass key values to the publish step to be set as properties on the output image. This is most helpful to set the description, but can be used to set anything needed. See https://stgraber.org/2016/03/30/lxd-2-0-image-management-512/ for more properties. -
launch_config(map[string]string) - List of key/value pairs you wish to pass tolxc launchvia--config. Defaults to empty.