mirror of
https://github.com/0x1d/terraform-docker-packer.git
synced 2025-12-15 14:18:24 +01:00
Example and docs
This commit is contained in:
9
main.tf
9
main.tf
@@ -1,12 +1,15 @@
|
||||
locals {
|
||||
packer_variables_file = "variables.pkrvars.hcl"
|
||||
packer_variables = <<-EOT
|
||||
%{ for key, value in var.packer_variables ~}
|
||||
${key} = ${try(jsonencode(value), "\"${value}\"")}
|
||||
%{ endfor ~}
|
||||
EOT
|
||||
}
|
||||
|
||||
resource "local_file" "packer_variables" {
|
||||
filename = local.packer_variables_file
|
||||
content = <<-EOT
|
||||
scripts = ${jsonencode(var.provisioning_scripts)}
|
||||
EOT
|
||||
content = local.packer_variables
|
||||
}
|
||||
|
||||
resource "docker_image" "packer" {
|
||||
|
||||
Reference in New Issue
Block a user