-
-
Notifications
You must be signed in to change notification settings - Fork 223
Expand file tree
/
Copy pathazure-image.json
More file actions
73 lines (73 loc) · 2.19 KB
/
azure-image.json
File metadata and controls
73 lines (73 loc) · 2.19 KB
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
{
"min_packer_version": "1.8",
"variables": {
"azure_client_id": "{{env `AZURE_CLIENT_ID`}}",
"azure_client_secret": "{{env `AZURE_CLIENT_SECRET`}}",
"azure_tenant_id": "{{env `AZURE_TENANT_ID`}}",
"azure_subscription_id": "{{env `AZURE_SUBSCRIPTION_ID`}}",
"azure_location": "westeurope",
"azure_vm_size": "Standard_D2s_v6",
"build_prefix": "",
"docker_version": "",
"image_repo": "",
"image_version": ""
},
"builders": [{
"type": "azure-arm",
"client_id": "{{user `azure_client_id`}}",
"client_secret": "{{user `azure_client_secret`}}",
"tenant_id": "{{user `azure_tenant_id`}}",
"subscription_id": "{{user `azure_subscription_id`}}",
"managed_image_resource_group_name": "dstack-resources-westeurope",
"managed_image_name": "{{user `build_prefix`}}dstack-{{user `image_version` | clean_resource_name}}",
"os_type": "Linux",
"image_publisher": "canonical",
"image_offer": "ubuntu-24_04-lts",
"image_sku": "server",
"azure_tags": {
"Name": "DSTACK"
},
"location": "{{user `azure_location`}}",
"vm_size": "{{user `azure_vm_size`}}"
}],
"provisioners": [
{
"type": "shell",
"inline": ["cloud-init status --long --wait"]
},
{
"type": "shell",
"scripts": [
"provisioners/kernel/apt-upgrade.sh",
"provisioners/kernel/apt-daily.sh",
"provisioners/kernel/apt-packages.sh",
"provisioners/kernel/kernel-tuning.sh"
]
},
{
"type": "file",
"source": "provisioners/install-docker.sh",
"destination": "/tmp/install-docker.sh"
},
{
"type": "file",
"source": "provisioners/run-docker",
"destination": "/tmp/run-docker"
},
{
"type": "shell",
"inline_shebang": "/bin/sh -x",
"inline": [
"cd /tmp",
"chmod +x install-docker.sh",
"./install-docker.sh --version {{user `docker_version`}}"
]
},
{
"type": "shell",
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline_shebang": "/bin/sh -x",
"inline": ["/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"]
}
]
}