Skip to content

Instantly share code, notes, and snippets.

@arhea
Created January 20, 2017 12:23
Show Gist options
  • Save arhea/64d9153a0cc0719ee171e48ea0b14d77 to your computer and use it in GitHub Desktop.
Save arhea/64d9153a0cc0719ee171e48ea0b14d77 to your computer and use it in GitHub Desktop.
Ubuntu 16 Packer.json
{
"variables": {
"aws_access_key": "",
"aws_secret_key": "",
"aws_account_id": "",
"aws_region": ""
},
"builders": [
{
"type": "amazon-ebs",
"region": "{{user `aws_region`}}",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"source_ami": "ami-29f96d3e",
"instance_type": "t2.small",
"ssh_username": "ubuntu",
"encrypt_boot": true,
"ami_name": "docker-{{timestamp}}",
"ami_description": "A Ubuntu 16.04 LTS based Docker AMI.",
"tags": {
"os": "ubuntu-16-04",
"docker-release": "opensource",
"docker-branch": "stable"
},
"launch_block_device_mappings": [
{
"device_name": "/dev/sda1",
"volume_size": 50,
"volume_type": "gp2",
"delete_on_termination": "true"
},
{
"device_name": "/dev/xvdb",
"volume_size": 100,
"volume_type": "gp2",
"delete_on_termination": "true",
"encrypted": "true"
}
],
"ami_block_device_mappings": [
{
"device_name": "/dev/sda1",
"volume_size": 50,
"volume_type": "gp2",
"delete_on_termination": "true"
},
{
"device_name": "/dev/xvdb",
"volume_size": 100,
"volume_type": "gp2",
"delete_on_termination": "true",
"encrypted": "true"
}
]
}
],
"provisioners": [
{
"type": "shell",
"script": "setup.sh",
"environment_vars": [
"AWS_REGION={{user `aws_region`}}"
],
"execute_command": "{{ .Vars }} sudo -E -S bash '{{ .Path }}'"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment