windows_10_docker.json 2.12 KB
Newer Older
1 2 3
{
  "builders": [
    {
4 5
      "boot_command": "",
      "boot_wait": "5s",
6 7 8
      "communicator": "winrm",
      "headless": false,
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
9 10 11
      "source_path": "{{user `source_path`}}",
      "type": "vmware-vmx",
      "vm_name": "windows_10_docker",
12 13 14 15 16 17
      "vmx_data": {
        "RemoteDisplay.vnc.enabled": "false",
        "RemoteDisplay.vnc.port": "5900",
        "memsize": "2048",
        "numvcpus": "2",
        "scsi0.virtualDev": "lsisas1068"
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
      },
      "vmx_remove_ethernet_interfaces": true,
      "vnc_port_max": 5980,
      "vnc_port_min": 5900,
      "winrm_password": "vagrant",
      "winrm_timeout": "15m",
      "winrm_username": "vagrant"
    }
  ],
  "post-processors": [
    {
      "keep_input_artifact": false,
      "output": "windows_10_docker_{{.Provider}}.box",
      "type": "vagrant",
      "vagrantfile_template": "vagrantfile-windows_10.template"
33 34 35 36 37
    }
  ],
  "provisioners": [
    {
      "scripts": [
38
        "./scripts/docker/10/install-containers-feature.ps1"
39 40
      ],
      "type": "powershell"
41 42 43 44 45
    },
    {
      "type": "windows-restart"
    },
    {
46 47 48 49 50
      "environment_vars": [
        "docker_images={{user `docker_images`}}",
        "docker_provider={{user `docker_provider`}}",
        "docker_version={{user `docker_version`}}"
      ],
51 52
      "scripts": [
        "./scripts/docker/add-docker-group.ps1",
53 54
        "./scripts/docker/install-docker.ps1",
        "./scripts/docker/docker-pull.ps1",
55
        "./scripts/docker/open-docker-insecure-port.ps1",
56
        "./scripts/docker/open-docker-swarm-ports.ps1",
57 58
        "./scripts/docker/remove-docker-key-json.ps1",
        "./scripts/docker/disable-windows-defender.ps1"
59 60
      ],
      "type": "powershell"
61 62 63 64
    },
    {
      "scripts": [
        "./scripts/uac-enable.bat",
65
        "./scripts/set-winrm-automatic.bat",
66
        "./scripts/compact.bat"
67 68
      ],
      "type": "windows-shell"
69 70 71
    }
  ],
  "variables": {
72 73 74
    "docker_images": "microsoft/windowsservercore microsoft/nanoserver",
    "docker_provider": "ce",
    "docker_version": "17.10.0",
75
    "source_path": "path-to.vmx"
76 77
  }
}
78