windows_2016_docker.json 5.89 KB
Newer Older
1 2
{
  "builders": [
3 4
    {
      "boot_wait": "0s",
5 6 7 8 9
      "communicator": "winrm",
      "cpu": 2,
      "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
      "ram_size": 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
      "disk_size": "{{user `disk_size`}}",
      "disk_type_id": "{{user `disk_type_id`}}",
37
      "floppy_files": [
Stefan Scherer's avatar
Stefan Scherer committed
38
        "{{user `autounattend`}}",
Stefan Scherer's avatar
Stefan Scherer committed
39
        "./scripts/disable-screensaver.ps1",
40 41
        "./scripts/disable-winrm.ps1",
        "./scripts/docker/enable-winrm.ps1",
42
        "./scripts/docker/2016/install-containers-feature.ps1",
43 44 45
        "./scripts/microsoft-updates.bat",
        "./scripts/win-updates.ps1"
      ],
46 47 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`}}",
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "type": "vmware-iso",
53
      "version": 12,
54
      "vm_name": "WindowsServer2016Docker",
55 56 57 58 59 60
      "vmx_data": {
        "RemoteDisplay.vnc.enabled": "false",
        "RemoteDisplay.vnc.port": "5900",
        "memsize": "2048",
        "numvcpus": "2",
        "scsi0.virtualDev": "lsisas1068",
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
      "disk_size": "{{user `disk_size`}}",
74
      "floppy_files": [
Stefan Scherer's avatar
Stefan Scherer committed
75
        "{{user `autounattend`}}",
Stefan Scherer's avatar
Stefan Scherer committed
76
        "./scripts/disable-screensaver.ps1",
77 78
        "./scripts/disable-winrm.ps1",
        "./scripts/docker/enable-winrm.ps1",
79
        "./scripts/docker/2016/install-containers-feature.ps1",
80
        "./scripts/microsoft-updates.bat",
Stefan Scherer's avatar
Stefan Scherer committed
81
        "./scripts/win-updates.ps1"
82
      ],
83 84 85 86 87 88 89 90 91
      "guest_additions_mode": "disable",
      "guest_os_type": "Windows2012_64",
      "headless": "{{user `headless`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_url": "{{user `iso_url`}}",
      "post_shutdown_delay": "10s",
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "type": "virtualbox-iso",
92 93 94 95 96 97 98 99 100 101 102 103 104
      "vboxmanage": [
        [
          "modifyvm",
          "{{.Name}}",
          "--memory",
          "2048"
        ],
        [
          "modifyvm",
          "{{.Name}}",
          "--cpus",
          "2"
        ]
105 106 107 108 109 110 111 112 113 114 115 116 117
      ],
      "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"
118 119 120 121 122 123 124 125
    }
  ],
  "provisioners": [
    {
      "execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
      "scripts": [
        "./scripts/vm-guest-tools.bat",
        "./scripts/enable-rdp.bat"
126 127
      ],
      "type": "windows-shell"
128
    },
Stefan Scherer's avatar
Stefan Scherer committed
129 130
    {
      "scripts": [
131 132
        "./scripts/debloat-windows.ps1",
        "./scripts/docker/set-winrm-automatic.ps1"
133 134
      ],
      "type": "powershell"
Stefan Scherer's avatar
Stefan Scherer committed
135
    },
136
    {
137 138
      "restart_timeout": "{{user `restart_timeout`}}",
      "type": "windows-restart"
139 140
    },
    {
141 142 143 144 145
      "environment_vars": [
        "docker_images={{user `docker_images`}}",
        "docker_provider={{user `docker_provider`}}",
        "docker_version={{user `docker_version`}}"
      ],
146
      "scripts": [
147
        "./scripts/docker/add-docker-group.ps1",
148 149
        "./scripts/docker/install-docker.ps1",
        "./scripts/docker/docker-pull.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
150
        "./scripts/docker/open-docker-insecure-port.ps1",
151
        "./scripts/docker/open-docker-swarm-ports.ps1",
152 153
        "./scripts/docker/remove-docker-key-json.ps1",
        "./scripts/docker/disable-windows-defender.ps1"
154 155
      ],
      "type": "powershell"
Stefan Scherer's avatar
Stefan Scherer committed
156 157 158
    },
    {
      "scripts": [
159
        "./scripts/set-winrm-automatic.bat",
160
        "./scripts/uac-enable.bat",
Stefan Scherer's avatar
Cleanup  
Stefan Scherer committed
161
        "./scripts/compile-dotnet-assemblies.bat",
162
        "./scripts/dis-updates.bat",
Stefan Scherer's avatar
Cleanup  
Stefan Scherer committed
163
        "./scripts/compact.bat"
164 165
      ],
      "type": "windows-shell"
166
    }
Stefan Scherer's avatar
Stefan Scherer committed
167 168
  ],
  "variables": {
169
    "autounattend": "./answer_files/2016_core/Autounattend.xml",
170 171
    "disk_size": "61440",
    "disk_type_id": "1",
172 173 174
    "docker_images": "microsoft/windowsservercore microsoft/nanoserver",
    "docker_provider": "DockerProvider",
    "docker_version": "stable",
175
    "headless": "false",
176
    "iso_checksum": "70721288BBCDFE3239D8F8C0FAE55F1F",
177 178
    "iso_checksum_type": "md5",
    "iso_url": "http://care.dlservice.microsoft.com/dl/download/1/4/9/149D5452-9B29-4274-B6B3-5361DBDA30BC/14393.0.161119-1705.RS1_REFRESH_SERVER_EVAL_X64FRE_EN-US.ISO",
179
    "restart_timeout": "5m",
180
    "vhv_enable": "false",
181
    "winrm_timeout": "6h"
Stefan Scherer's avatar
Stefan Scherer committed
182
  }
183
}
184