1 year ago
#298213
siphesihle
Building a ConsoleMe image using Packer
I am trying to build a ConsoleMe image using Packer and I am getting the following error message: Error: Failed to prepare build: "amazon-ebs" 1 error(s) occurred: * Destination must be specified.
How can I solve it?
Below is the template that I'm using for the build
"builders": [
{
"ami_name": "consoleme {{timestamp}}",
"instance_type": "t2.micro",
"region": "us-east-1",
"source_ami_filter": {
"filters": {
"name": "ubuntu/images/*ubuntu-focal-20.04-amd64-server-*",
"root-device-type": "ebs",
"virtualization-type": "hvm"
},
"most_recent": true,
"owners": ["099720109477"]
},
"ssh_username": "ubuntu",
"type": "amazon-ebs"
}
],
"provisioners": [
{
"inline": ["sleep 30"],
"type": "shell"
},
{
"inline": [
"export CONFIG_LOCATION={{user `CONFIG_LOCATION`}}",
"export CONSOLEME_CONFIG_ENTRYPOINT={{user `CONSOLEME_CONFIG_ENTRYPOINT`}}",
"sudo mkdir -p /apps/consoleme",
"sudo chown -R ubuntu /apps/"
],
"type": "shell"
},
{
"destination": "{{user `app_archive`}}",
"source": "{{user `app_archive`}}",
"type": "file"
},
{
"inline": [
"tar -xzf {{user `app_archive`}} -C /apps/consoleme/",
"sudo cp -R /apps/consoleme/packer/root/* /",
"rm {{user `app_archive`}}"
],
"variables": {
"CONFIG_LOCATION": "{{env `CONFIG_LOCATION`}}",
"CONSOLEME_CONFIG_ENTRYPOINT": "{{env `CONSOLEME_CONFIG_ENTRYPOINT`}}",
"app_archive": ""
}
}```
containers
amazon-ecs
hashicorp-packer
0 Answers
Your Answer