You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With LXD configured on a local machine (on which packer will run) and a pre-configured LXD remote, I can use the LXD builder to launch and provision a container on the remote LXD server by setting container_name = "remote-name:container-name".
The LXD builder then launches the image on the remote LXD server and I can use e.g. ansible with ansible_connection=lxd and ansible_lxd_remote=remote-name to provision it.
However, after the provisioning is completed, the LXD builder publishes the image on the remote LXD server but then copies it to the local machine and deletes the image on the remote server.
Even if I specify the remote server in output_image (e.g. output_image = "remote-name:output-image"), I still end up with an image on the local machine (which is named remote-name:output-image) and no image on the remote server.
Feature request:
If I launch and provision an LXD container on a remote LXD server, then I would like to be able to publish the image on the same remote LXD server instead of having it download to the local machine on which packer is running.
(Note: this would be the same behaviour as the Amazon AMI Builder, which launches an AMI on AWS, provisions it and then publishes the new image to the AWS account's image repository).
Use Case(s)
The use-case is to use packer on a local machine to build and publish images on a remote LXD server, which can then be launched on that server with Terraform.
Potential configuration
The existing configuration could be re-used so that output_image is parsed and if the form remote-name:output-image is found, then the lxd publish command is lxc publish container-name remote-name: --alias output-image and notlxc publish remote-name:container-name --alias output-image.
E.g.
build {
source "lxd.container" {
container_name = "remote-name:container-name"
output_image = "remote-name:output-image" ### This parsed to detect and identify the LXD remote
}
provisioner "ansible" {
...
}
}
Alternatively, a new configuration parameter could be introduced. For example remote_publish: "remote-name", so that the lxd publish command is lxc publish container-name remote-name: --alias output-image
...but this would then force both build and publish to be on the remote machine, which may not be wanted by some users, so for full flexibility we could have, e.g.
Description
With LXD configured on a local machine (on which packer will run) and a pre-configured LXD remote, I can use the LXD builder to launch and provision a container on the remote LXD server by setting
container_name = "remote-name:container-name"
.The LXD builder then launches the image on the remote LXD server and I can use e.g. ansible with
ansible_connection=lxd
andansible_lxd_remote=remote-name
to provision it.However, after the provisioning is completed, the LXD builder publishes the image on the remote LXD server but then copies it to the local machine and deletes the image on the remote server.
Even if I specify the remote server in
output_image
(e.g.output_image = "remote-name:output-image"
), I still end up with an image on the local machine (which is named remote-name:output-image) and no image on the remote server.Feature request:
If I launch and provision an LXD container on a remote LXD server, then I would like to be able to publish the image on the same remote LXD server instead of having it download to the local machine on which packer is running.
(Note: this would be the same behaviour as the Amazon AMI Builder, which launches an AMI on AWS, provisions it and then publishes the new image to the AWS account's image repository).
Use Case(s)
The use-case is to use packer on a local machine to build and publish images on a remote LXD server, which can then be launched on that server with Terraform.
Potential configuration
The existing configuration could be re-used so that
output_image
is parsed and if the formremote-name:output-image
is found, then the lxd publish command islxc publish container-name remote-name: --alias output-image
and notlxc publish remote-name:container-name --alias output-image
.E.g.
Alternatively, a new configuration parameter could be introduced. For example
remote_publish: "remote-name"
, so that the lxd publish command islxc publish container-name remote-name: --alias output-image
E.g.
Maybe cleaner would then be to use a single
remote
configuration parameter for modifying bothcontainer_name
andoutput_image
.E.g.
...but this would then force both build and publish to be on the remote machine, which may not be wanted by some users, so for full flexibility we could have, e.g.
Hope that makes sense.
Thanks in advance!
The text was updated successfully, but these errors were encountered: