Packer is an open source tool that enables you to create identical machine images for multiple platforms from a single source template.
- Examples
aws-ubuntu.pkr.hcl
: An Example from Packer official website, to test whether your packer work or not
- aws
- ami
- dolphinscheduler: AWS AMI builder for Apache DolphinScheduler, you can see dolphinscheduler AWS AMI builder for more detail
- ami
See install packer about how to install packer.
We here using template in examples/aws-ubuntu.pkr.hcl
as example
# export AWS key and secret
export AWS_ACCESS_KEY_ID="<YOUR_AWS_ACCESS_KEY_ID>"
export AWS_SECRET_ACCESS_KEY="<YOUR_AWS_SECRET_ACCESS_KEY>"
cd examples
packer init .
packer build aws-ubuntu.pkr.hcl
For more detail you can see Build an Image
It means your AMI with name '[NAME-OF-YOUR-AMI]' already exists in your AMIs (some time you have your region to find the exists AMIs). In this case you should:
- Remove exists AMIs: remove exists AMI with name '[NAME-OF-YOUR-AMI]', ref to deregister-ami if you want to see more detail.
- Rename your
ami_name
attribute in your*.pkr.hcl
: rename the attribute in your*.pkr.hcl
file to not exists name.