Created
June 5, 2017 20:11
-
-
Save jacoelho/3cf646e85add71da7d9b1255322c7b9f to your computer and use it in GitHub Desktop.
docker machine windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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