windows_2016_docker.json 5.68 KB
Newer Older
1 2
{
  "builders": [
3 4
    {
      "boot_wait": "0s",
5
      "communicator": "winrm",
6
      "cpus": 2,
7 8 9
      "disk_size": "{{user `disk_size`}}",
      "enable_secure_boot": true,
      "enable_virtualization_extensions": true,
10
      "floppy_files": [
Stefan Scherer's avatar
Stefan Scherer committed
11
        "{{user `autounattend`}}",
Stefan Scherer's avatar
Stefan Scherer committed
12
        "./scripts/disable-screensaver.ps1",
13 14
        "./scripts/disable-winrm.ps1",
        "./scripts/docker/enable-winrm.ps1",
15
        "./scripts/docker/2016/install-containers-feature.ps1",
16 17 18
        "./scripts/microsoft-updates.bat",
        "./scripts/win-updates.ps1"
      ],
19 20 21 22
      "guest_additions_mode": "disable",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_url": "{{user `iso_url`}}",
23
      "memory": 2048,
24 25 26 27 28 29 30
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "switch_name": "{{user `hyperv_switchname`}}",
      "type": "hyperv-iso",
      "vm_name": "WindowsServer2016Docker",
      "winrm_password": "vagrant",
      "winrm_timeout": "{{user `winrm_timeout`}}",
      "winrm_username": "vagrant"
31
    },
32
    {
33
      "boot_wait": "2m",
34
      "communicator": "winrm",
35 36
      "cpus": 2,
      "disk_adapter_type": "lsisas1068",
37 38
      "disk_size": "{{user `disk_size`}}",
      "disk_type_id": "{{user `disk_type_id`}}",
39
      "floppy_files": [
Stefan Scherer's avatar
Stefan Scherer committed
40
        "{{user `autounattend`}}",
Stefan Scherer's avatar
Stefan Scherer committed
41
        "./scripts/disable-screensaver.ps1",
42 43
        "./scripts/disable-winrm.ps1",
        "./scripts/docker/enable-winrm.ps1",
44
        "./scripts/docker/2016/install-containers-feature.ps1",
45 46 47
        "./scripts/microsoft-updates.bat",
        "./scripts/win-updates.ps1"
      ],
48 49 50 51 52
      "guest_os_type": "windows9srv-64",
      "headless": "{{user `headless`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_url": "{{user `iso_url`}}",
53
      "memory": 2048,
54 55
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "type": "vmware-iso",
56
      "version": 14,
57
      "vm_name": "WindowsServer2016Docker",
58 59 60
      "vmx_data": {
        "RemoteDisplay.vnc.enabled": "false",
        "RemoteDisplay.vnc.port": "5900",
61
        "vhv.enable": "{{user `vhv_enable`}}"
62 63 64 65 66 67 68
      },
      "vmx_remove_ethernet_interfaces": true,
      "vnc_port_max": 5980,
      "vnc_port_min": 5900,
      "winrm_password": "vagrant",
      "winrm_timeout": "{{user `winrm_timeout`}}",
      "winrm_username": "vagrant"
69 70
    },
    {
71
      "boot_wait": "2m",
72
      "communicator": "winrm",
73
      "cpus": 2,
74
      "disk_size": "{{user `disk_size`}}",
75
      "floppy_files": [
Stefan Scherer's avatar
Stefan Scherer committed
76
        "{{user `autounattend`}}",
Stefan Scherer's avatar
Stefan Scherer committed
77
        "./scripts/disable-screensaver.ps1",
78 79
        "./scripts/disable-winrm.ps1",
        "./scripts/docker/enable-winrm.ps1",
80
        "./scripts/docker/2016/install-containers-feature.ps1",
81
        "./scripts/microsoft-updates.bat",
Stefan Scherer's avatar
Stefan Scherer committed
82
        "./scripts/win-updates.ps1"
83
      ],
84
      "guest_additions_mode": "disable",
Stefan Scherer's avatar
Stefan Scherer committed
85
      "guest_os_type": "Windows2016_64",
86 87 88 89
      "headless": "{{user `headless`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_url": "{{user `iso_url`}}",
90
      "memory": 2048,
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
      "post_shutdown_delay": "10s",
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "type": "virtualbox-iso",
      "vm_name": "WindowsServer2016Docker",
      "winrm_password": "vagrant",
      "winrm_timeout": "{{user `winrm_timeout`}}",
      "winrm_username": "vagrant"
    }
  ],
  "post-processors": [
    {
      "keep_input_artifact": false,
      "output": "windows_2016_docker_{{.Provider}}.box",
      "type": "vagrant",
      "vagrantfile_template": "vagrantfile-windows_2016_core.template"
106 107 108 109 110 111 112 113
    }
  ],
  "provisioners": [
    {
      "execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
      "scripts": [
        "./scripts/vm-guest-tools.bat",
        "./scripts/enable-rdp.bat"
114 115
      ],
      "type": "windows-shell"
116
    },
Stefan Scherer's avatar
Stefan Scherer committed
117 118
    {
      "scripts": [
119 120
        "./scripts/debloat-windows.ps1",
        "./scripts/docker/set-winrm-automatic.ps1"
121 122
      ],
      "type": "powershell"
Stefan Scherer's avatar
Stefan Scherer committed
123
    },
124
    {
125 126
      "restart_timeout": "{{user `restart_timeout`}}",
      "type": "windows-restart"
127 128
    },
    {
129 130 131 132 133
      "environment_vars": [
        "docker_images={{user `docker_images`}}",
        "docker_provider={{user `docker_provider`}}",
        "docker_version={{user `docker_version`}}"
      ],
134
      "scripts": [
135
        "./scripts/docker/add-docker-group.ps1",
136 137
        "./scripts/docker/install-docker.ps1",
        "./scripts/docker/docker-pull.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
138
        "./scripts/wait-for-tiworker.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
139
        "./scripts/docker/open-docker-insecure-port.ps1",
140
        "./scripts/docker/open-docker-swarm-ports.ps1",
141 142
        "./scripts/docker/remove-docker-key-json.ps1",
        "./scripts/docker/disable-windows-defender.ps1"
143 144
      ],
      "type": "powershell"
Stefan Scherer's avatar
Stefan Scherer committed
145 146 147
    },
    {
      "scripts": [
148
        "./scripts/set-winrm-automatic.bat",
149
        "./scripts/uac-enable.bat",
Stefan Scherer's avatar
Cleanup  
Stefan Scherer committed
150
        "./scripts/compile-dotnet-assemblies.bat",
151
        "./scripts/dis-updates.bat",
Stefan Scherer's avatar
Cleanup  
Stefan Scherer committed
152
        "./scripts/compact.bat"
153 154
      ],
      "type": "windows-shell"
155
    }
Stefan Scherer's avatar
Stefan Scherer committed
156 157
  ],
  "variables": {
158
    "autounattend": "./answer_files/2016_core/Autounattend.xml",
159 160
    "disk_size": "61440",
    "disk_type_id": "1",
Stefan Scherer's avatar
Stefan Scherer committed
161
    "docker_images": "mcr.microsoft.com/windows/servercore:ltsc2016",
162
    "docker_provider": "ee",
Stefan Scherer's avatar
Stefan Scherer committed
163
    "docker_version": "18-09-6",
164
    "headless": "false",
165
    "iso_checksum": "70721288BBCDFE3239D8F8C0FAE55F1F",
166
    "iso_checksum_type": "md5",
167
    "iso_url": "https://software-download.microsoft.com/download/pr/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO",
168
    "restart_timeout": "5m",
169
    "vhv_enable": "false",
170
    "winrm_timeout": "6h"
Stefan Scherer's avatar
Stefan Scherer committed
171
  }
172
}
173