forked from IvanRibakov/post-packer-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.json
49 lines (49 loc) · 1.13 KB
/
template.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
{
"variables": {
"output_path": "./output"
},
"builders": [
{
"type": "vagrant",
"source_path": "centos/7",
"ssh_port": 22,
"ssh_username": "vagrant",
"communicator": "ssh",
"add_force": true,
"provider": "virtualbox",
"output_dir": "{{user `output_path`}}/vagrant"
},
{
"type": "docker",
"image": "centos:7",
"export_path": "{{user `output_path`}}/docker/image.tar"
}
],
"provisioners": [
{
"type": "shell",
"inline": "yum install -y sudo",
"only": ["docker"]
},
{
"type": "shell",
"inline": [
"echo Starting Provisioning",
"sudo rpm --import http://packages.irontec.com/public.key",
"REPOFILE=irontec.repo",
"cat <<'EOF' > /tmp/${REPOFILE}\n[irontec]\nname=Irontec RPMs repository\nbaseurl=http://packages.irontec.com/centos/$releasever/$basearch/\nEOF",
"sudo mv /tmp/${REPOFILE} /etc/yum.repos.d/",
"sudo yum install -y sngrep",
"sudo rm -f /etc/yum.repos.d/${REPOFILE}"
]
}
],
"post-processors": [
{
"type": "docker-import",
"repository": "zaleos",
"tag": "demo",
"only": ["docker"]
}
]
}