-
Notifications
You must be signed in to change notification settings - Fork 5
/
packer.json
60 lines (60 loc) · 1.56 KB
/
packer.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
"variables": {
"BASE_USER": "butler",
"FS_DEVICE_NAME": "/dev/xvdb",
"FS_DEVICE_SIZE": "20"
},
"builders": [
{
"type": "amazon-ebs",
"name": "aws",
"region": "us-east-1",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "Moby Linux * stable",
"root-device-type": "ebs"
},
"most_recent": true
},
"instance_type": "t2.micro",
"ami_block_device_mappings": [
{
"device_name": "{{user `FS_DEVICE_NAME`}}",
"volume_size": "{{user `FS_DEVICE_SIZE`}}",
"volume_type": "gp2",
"delete_on_termination": true
}
],
"launch_block_device_mappings": [
{
"device_name": "{{user `FS_DEVICE_NAME`}}",
"volume_size": "{{user `FS_DEVICE_SIZE`}}",
"volume_type": "gp2",
"delete_on_termination": true
}
],
"ssh_username": "docker",
"ami_name": "oufti-lab-{{timestamp}}"
}
],
"provisioners": [
{
"type": "file",
"source": "./docker",
"destination": "/tmp"
},
{
"type": "shell",
"execute_command": "{{ .Vars }} sudo -E -S /bin/sh '{{ .Path }}'",
"inline": [
"apk add --no-cache py-pip",
"pip install docker-compose",
"mv /tmp/docker /docker",
"cd /docker;docker-compose build",
"docker build -t launcher /docker",
"docker run -d -t --restart=unless-stopped -v /var/run/docker.sock:/var/run/docker.sock launcher"
]
}
]
}