github.com/ratanraj/packer@v1.3.2/website/source/docs/builders/lxd.html.md (about)

     1  ---
     2  description: |
     3      The `lxd` Packer builder builds containers for LXD. The builder starts an LXD
     4      container, runs provisioners within this container, then saves the container
     5      as an LXD image.
     6  layout: docs
     7  page_title: 'LXD - Builders'
     8  sidebar_current: 'docs-builders-lxd'
     9  ...
    10  
    11  # LXD Builder
    12  
    13  Type: `lxd`
    14  
    15  The `lxd` Packer builder builds containers for LXD. The builder starts an LXD
    16  container, runs provisioners within this container, then saves the container
    17  as an LXD image.
    18  
    19  The LXD builder requires a modern linux kernel and the `lxd` package.
    20  This builder does not work with LXC.
    21  
    22  ## Basic Example
    23  
    24  Below is a fully functioning example.
    25  
    26  ``` {.javascript}
    27  {
    28    "builders": [
    29      {
    30        "type": "lxd",
    31        "name": "lxd-xenial",
    32        "image": "ubuntu-daily:xenial",
    33        "output_image": "ubuntu-xenial",
    34        "publish_properties": {
    35          "description": "Trivial repackage with Packer"
    36        }
    37      }
    38    ]
    39  }
    40  ```
    41  
    42  
    43  ## Configuration Reference
    44  
    45  ### Required:
    46  
    47  -  `image` (string) - The source image to use when creating the build
    48     container. This can be a (local or remote) image (name or fingerprint). E.G.
    49     `my-base-image`, `ubuntu-daily:x`, `08fababf6f27`, ...
    50  
    51      ~> Note: The builder may appear to pause if required to download
    52      a remote image, as they are usually 100-200MB. `/var/log/lxd/lxd.log` will
    53      mention starting such downloads.
    54  
    55  ### Optional:
    56  
    57  -  `init_sleep` (string) - The number of seconds to sleep between launching the
    58     LXD instance and provisioning it; defaults to 3 seconds.
    59  
    60  -  `name` (string) - The name of the started container. Defaults to
    61     `packer-$PACKER_BUILD_NAME`.
    62  
    63  -  `output_image` (string) - The name of the output artifact. Defaults to
    64     `name`.
    65  
    66  -  `command_wrapper` (string) - Lets you prefix all builder commands, such as
    67     with `ssh` for a remote build host. Defaults to `""`.
    68  
    69  -  `publish_properties` (map[string]string) - Pass key values to the publish
    70     step to be set as properties on the output image. This is most helpful to
    71     set the description, but can be used to set anything needed.
    72     See https://stgraber.org/2016/03/30/lxd-2-0-image-management-512/
    73     for more properties.
    74  
    75  -  `launch_config` (map[string]string) - List of key/value pairs you wish to
    76     pass to `lxc launch` via `--config`. Defaults to empty.