windows_2016_docker_azure.json 2.27 KB
Newer Older
1 2 3
{
  "builders": [
    {
4 5
      "capture_container_name": "images",
      "capture_name_prefix": "WindowsServer2016Docker",
6 7 8
      "client_id": "{{user `app_id`}}",
      "client_secret": "{{user `client_secret`}}",
      "cloud_environment_name": "Public",
9
      "communicator": "winrm",
10
      "image_offer": "WindowsServer",
11
      "image_publisher": "MicrosoftWindowsServer",
12 13
      "image_sku": "2016-Datacenter",
      "image_version": "latest",
14 15 16 17 18 19 20 21 22
      "location": "West Europe",
      "object_id": "{{user `object_id`}}",
      "os_type": "Windows",
      "resource_group_name": "{{user `resource_group`}}",
      "storage_account": "{{user `storage_account`}}",
      "subscription_id": "{{user `azure_subscription_id`}}",
      "tenant_id": "{{user `azure_ad_tenant_id`}}",
      "type": "azure-arm",
      "vm_size": "Standard_D2_v2",
23 24
      "winrm_insecure": "true",
      "winrm_timeout": "3m",
25
      "winrm_use_ssl": "true",
26 27 28
      "winrm_username": "packer"
    }
  ],
29
  "post-processors": [],
30 31
  "provisioners": [
    {
32
      "scripts": [
Stefan Scherer's avatar
Stefan Scherer committed
33
        "./scripts/docker/2016/install-containers-feature.ps1"
34 35
      ],
      "type": "powershell"
36
    },
37 38 39
    {
      "type": "windows-restart"
    },
40
    {
41 42 43 44 45
      "environment_vars": [
        "docker_images={{user `docker_images`}}",
        "docker_provider={{user `docker_provider`}}",
        "docker_version={{user `docker_version`}}"
      ],
46 47
      "scripts": [
        "./scripts/docker/add-docker-group.ps1",
48
        "./scripts/docker/disable-windows-defender.ps1",
49 50
        "./scripts/docker/install-docker.ps1",
        "./scripts/docker/docker-pull.ps1",
51
        "./scripts/docker/remove-docker-key-json.ps1"
52 53
      ],
      "type": "powershell"
54
    }
55 56 57 58 59 60
  ],
  "variables": {
    "app_id": "{{env `PACKER_AZURE_APP_ID`}}",
    "azure_ad_tenant_id": "{{env `PACKER_AZURE_AD_TENANT_ID`}}",
    "azure_subscription_id": "{{env `PACKER_AZURE_SUBSCRIPTION_ID`}}",
    "client_secret": "{{env `PACKER_AZURE_CLIENT_SECRET`}}",
61 62 63
    "docker_images": "microsoft/windowsservercore microsoft/nanoserver",
    "docker_provider": "DockerProvider",
    "docker_version": "stable",
64 65 66 67 68
    "headless": "false",
    "object_id": "{{env `PACKER_AZURE_OBJECT_ID`}}",
    "resource_group": "{{env `PACKER_AZURE_RESOURCE_GROUP`}}",
    "storage_account": "{{env `PACKER_AZURE_STORAGE_ACCOUNT`}}"
  }
69
}
70