Skip to content

Instantly share code, notes, and snippets.

@jacoelho
Created June 5, 2017 20:11
Show Gist options
  • Save jacoelho/3cf646e85add71da7d9b1255322c7b9f to your computer and use it in GitHub Desktop.
Save jacoelho/3cf646e85add71da7d9b1255322c7b9f to your computer and use it in GitHub Desktop.
docker machine windows
Import-Module Hyper-V
if(!(Test-Path -Path "C:\Program Files\Docker\Docker")) {
$docker = [System.IO.Path]::GetTempFileName()
Invoke-WebRequest -Uri "https://download.docker.com/win/stable/InstallDocker.msi" -OutFile $docker
Start-Process msiexec.exe -ArgumentList "/i", $docker, "/quiet", "/norestart" -NoNewWindow -Wait
Remove-Item $docker
}
$switch = Get-VMSwitch | ? { $_.Name -Match "ExternalSwitch" }
if(-not $switch) {
New-VMSwitch -Name ExternalSwitch -NetAdapterName (Get-NetAdapter -Name ethernet).Name -AllowManagementOS $true -Notes 'Parent OS, VMs, LAN'
}
& "C:\Program Files\Docker\Docker\resources\bin\docker-machine" create --driver hyperv default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment