windows_2016_docker_azure.json 1.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
{
 "variables": {
    "azure_ad_tenant_id": "{{env `PACKER_AZURE_AD_TENANT_ID`}}",
    "azure_subscription_id": "{{env `PACKER_AZURE_SUBSCRIPTION_ID`}}",
    "object_id": "{{env `PACKER_AZURE_OBJECT_ID`}}",
    "app_id": "{{env `PACKER_AZURE_APP_ID`}}",
    "client_secret": "{{env `PACKER_AZURE_CLIENT_SECRET`}}",
    "resource_group": "{{env `PACKER_AZURE_RESOURCE_GROUP`}}",
    "storage_account": "{{env `PACKER_AZURE_STORAGE_ACCOUNT`}}"
  },
  "builders": [
    {
      "type": "azure-arm",
      "subscription_id": "{{user `azure_subscription_id`}}",
      "tenant_id": "{{user `azure_ad_tenant_id`}}",
      "object_id": "{{user `object_id`}}",
      "client_id": "{{user `app_id`}}",
      "client_secret": "{{user `client_secret`}}",
      "resource_group_name": "{{user `resource_group`}}",

      "cloud_environment_name": "Public",
Stefan Scherer's avatar
Stefan Scherer committed
22 23
      "location": "West Europe",
      "vm_size": "Standard_D2_v2",
24 25 26

      "storage_account": "{{user `storage_account`}}",
      "capture_container_name": "images",
Stefan Scherer's avatar
Stefan Scherer committed
27
      "capture_name_prefix": "WindowsServer2016Docker",
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44

      "os_type": "Windows",
      "image_publisher": "MicrosoftWindowsServer",
      "image_offer": "WindowsServer",
      "image_sku": "2016-Datacenter",
      "image_version": "latest",

      "communicator": "winrm",
      "winrm_use_ssl": "true",
      "winrm_insecure": "true",
      "winrm_timeout": "3m",
      "winrm_username": "packer"
    }
  ],
  "provisioners": [
    {
      "type": "powershell",
45 46
      "scripts": [
        "./scripts/docker/install-containers-feature.ps1"
47 48
      ]
    },
49 50 51
    {
      "type": "windows-restart"
    },
52 53 54 55
    {
      "type": "powershell",
      "scripts": [
        "./scripts/docker/add-docker-group.ps1",
56
        "./scripts/docker/disable-windows-defender.ps1",
57
        "./scripts/docker/install-docker.ps1",
58
        "./scripts/docker/docker-pull-async.ps1",
59
        "./scripts/docker/remove-docker-key-json.ps1"
60 61 62 63
      ]
    }
  ]
}