-
Notifications
You must be signed in to change notification settings - Fork 9
/
alpine2docker.json
96 lines (96 loc) · 2.76 KB
/
alpine2docker.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{
"description": "Build a minimalistic VM for Docker with Linux Alpine",
"variables": {
"BASE_USER": "alpine",
"BOX_FILE": "{{ env `BOX_FILE`}}"
},
"builders": [
{
"name": "vbox",
"type": "virtualbox-iso",
"headless": true,
"vboxmanage": [
["modifyvm","{{.Name}}","--cpus","1"],
["modifyvm","{{.Name}}","--memory","1024"],
["modifyvm","{{.Name}}","--cableconnected1","on"],
["modifyvm","{{.Name}}","--audio","none"],
["modifyvm","{{.Name}}","--usb","off"]
],
"disk_size": 40960,
"guest_os_type": "Linux26_64",
"iso_urls": [
"http://dl-cdn.alpinelinux.org/alpine/v3.11/releases/x86_64/alpine-virt-3.11.2-x86_64.iso"
],
"iso_checksum": "fbedd5fa113eee18876c293177d251b851bfe496a78b080b13e30ba1fd184bb2",
"iso_checksum_type": "sha256",
"communicator": "ssh",
"http_directory": "./http",
"boot_wait": "20s",
"boot_command": [
"root<enter><wait>",
"ifconfig eth0 up && udhcpc -i eth0<enter><wait>",
"wget -O /tmp/answers http://{{ .HTTPIP }}:{{ .HTTPPort }}/answers<enter><wait>",
"setup-alpine -f /tmp/answers<enter><wait5>",
"root<enter><wait>",
"root<enter><wait>",
"<wait10><wait10>",
"y<enter>",
"<wait10><wait10>",
"<wait10><wait10>",
"<wait10><wait10>",
"rc-service sshd stop<enter>",
"mount /dev/vg0/lv_root /mnt<enter>",
"echo 'PermitRootLogin yes' >> /mnt/etc/ssh/sshd_config<enter>",
"umount /mnt<enter>",
"reboot<enter>"
],
"guest_additions_mode": "disable",
"virtualbox_version_file": ".vbox_version",
"ssh_username": "root",
"ssh_password": "root",
"ssh_wait_timeout": "10m",
"shutdown_command": "/sbin/poweroff"
}
],
"provisioners": [
{
"type": "shell",
"execute_command": "{{ .Vars }} /bin/sh '{{ .Path }}'",
"environment_vars": [
"BASE_USER={{user `BASE_USER`}}"
],
"scripts": [
"./scripts/base.sh",
"./scripts/vagrant.sh",
"./scripts/sudoers.sh",
"./scripts/docker.sh"
]
},
{
"type": "file",
"source": "./customize/",
"destination": "/var/customize/",
"pause_before": "30s"
},
{
"type": "shell",
"execute_command": "{{ .Vars }} /bin/sh '{{ .Path }}'",
"environment_vars": [
"BASE_USER={{user `BASE_USER`}}"
],
"scripts": [
"./scripts/sshd.sh",
"./scripts/customize.sh",
"./scripts/clean.sh"
]
}
],
"post-processors": [
{
"type": "vagrant",
"only": ["vbox"],
"vagrantfile_template": "vagrantfile-box.tpl",
"output": "{{user `BOX_FILE`}}"
}
]
}