-
Notifications
You must be signed in to change notification settings - Fork 0
/
packer_docker.json
44 lines (44 loc) · 1.61 KB
/
packer_docker.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
"variables": {
"aws_access_key" : "{{env `AWS_ACCESS_KEY_ID`}}",
"aws_secret_key" : "{{env `AWS_SECRET_ACCESS_KEY`}}",
"aws_region" : "us-east-1",
"app_name" : "docker",
"source_ami_product_code" : "{{env `CENTOS7_AMI_PRODUCT_CODE`}}"
},
"builders": [{
"name" : "{{user `app_name` }}",
"ami_name" : "{{user `app_name` }}-{{timestamp}}",
"ami_description" : "Centos AMI with Docker-CE",
"type" : "amazon-ebs",
"access_key" : "{{user `aws_access_key`}}",
"secret_key" : "{{user `aws_secret_key`}}",
"region" : "{{user `aws_region`}}",
"instance_type" : "t2.micro",
"ssh_username" : "centos",
"associate_public_ip_address" : "false",
"run_tags" : { "Name": "packer_{{user `app_name` }}" },
"tags": {
"Name" : "packer_docker",
"OS Version": "Centos",
"Tool" : "Packer",
"Author" : "Abhimanyu Narwal"
},
"source_ami_filter": {
"filters" : {
"virtualization-type" : "hvm",
"product-code" : "{{user `source_ami_product_code`}}"
},
"most_recent": true,
"owners" : ["aws-marketplace"]
}
}],
"provisioners": [
{
"type" : "shell",
"pause_before": "30s",
"scripts" : [
"scripts/install-docker.sh"
]
}]
}