packer-cn/website/source/partials/builder/lxc/_Config-not-required.html.md

2.0 KiB

  • output_directory (string) - The directory in which to save the exported tar.gz. Defaults to output- in the current directory.

  • container_name (string) - The name of the LXC container. Usually stored in /var/lib/lxc/containers/<container_name>. Defaults to packer-.

  • command_wrapper (string) - Allows you to specify a wrapper command, such as ssh so you can execute packer builds on a remote host. Defaults to {{.Command}}; i.e. no wrapper.

  • init_timeout (duration string | ex: "1h5m2s") - The timeout in seconds to wait for the the container to start. Defaults to 20 seconds.

  • create_options ([]string) - Options to pass to lxc-create. For instance, you can specify a custom LXC container configuration file with ["-f", "/path/to/lxc.conf"]. Defaults to []. See man 1 lxc-create for available options.

  • start_options ([]string) - Options to pass to lxc-start. For instance, you can override parameters from the LXC container configuration file via ["--define", "KEY=VALUE"]. Defaults to []. See man 1 lxc-start for available options.

  • attach_options ([]string) - Options to pass to lxc-attach. For instance, you can prevent the container from inheriting the host machine's environment by specifying ["--clear-env"]. Defaults to []. See man 1 lxc-attach for available options.

  • template_parameters ([]string) - Options to pass to the given lxc-template command, usually located in /usr/share/lxc/templates/lxc-<template_name>. Note: This gets passed as ARGV to the template command. Ensure you have an array of strings, as a single string with spaces probably won't work. Defaults to [].

  • target_runlevel (int) - The minimum run level to wait for the container to reach. Note some distributions (Ubuntu) simulate run levels and may report 5 rather than 3.