Skip to content

Instantly share code, notes, and snippets.

@logankimmel
Created June 15, 2018 14:28
Show Gist options
  • Save logankimmel/9c17bd24b21ac193ad40e5ee432474a7 to your computer and use it in GitHub Desktop.
Save logankimmel/9c17bd24b21ac193ad40e5ee432474a7 to your computer and use it in GitHub Desktop.
Automation Script to install Docker for Windows on Windows 10
#Docker for Windows:
Invoke-Webrequest -UseBasicparsing -Outfile "$env:TEMP\DockerForWindows.exe" "https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe"
Start-Process -FilePath "$env:TEMP\DockerForWindows.exe" -ArgumentList "install","--quiet" -Wait
New-NetFirewallRule -DisplayName "vpnkit" -Direction Inbound -Program "C:\Program Files\docker\docker\resources\vpnkit.exe" -Profile Public -Action Block -Protocol UDP
New-NetFirewallRule -DisplayName "vpnkit" -Direction Inbound -Program "C:\Program Files\docker\docker\resources\vpnkit.exe" -Profile Public -Action Block -Protocol TCP
New-NetFirewallRule -DisplayName "vpnkit" -Direction Inbound -Program "C:\Program Files\docker\docker\resources\vpnkit.exe" -Profile Private -Action Allow -Protocol UDP
New-NetFirewallRule -DisplayName "vpnkit" -Direction Inbound -Program "C:\Program Files\docker\docker\resources\vpnkit.exe" -Profile Private -Action Allow -Protocol TCP
$null = Enable-WindowsOptionalFeature -Online -FeatureName containers -All -NoRestart
$null = Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All -NoRestart
#Optionally, add a local user to the docker-users group
Add-LocalGroupMember -Group "docker-users" -Member "test"
# Optionally, add a domain group to the docker-users group
# $Domain = "{domain}"
# $LocalGroup = "docker-users"
# $ServerAdminGroup = "{domain-group}"
# ([adsi]"WinNT://./$LocalGroup,group").ADD("WinNT://$domain/$ServerAdminGroup")
Restart-Computer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment