Currently, there are a couple of methods of installing Docker on Windows:

  • Windows 10: Docker Desktop (Windows + Linux containers)

https://www.docker.com/products/docker-desktop

This installs the whole shebang on Windows 10, with Hyper-V VM and all. I'm not sure why there is no built-in option to only install the Windows Containers part.

  • Windows Server 2016+: DockerMsftProvider (Windows containers only)
# Custom package provider, allows PowerShell to install Docker from different sources
# https://github.com/OneGet/MicrosoftDockerProvider
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force

# Install Docker
Install-Package -Name docker -ProviderName DockerMsftProvider -Force

# Start the installed Windows service
Start-Service docker  

This doesn't seem to work on Windows 10 (or at least my crap doesn't).

Install-Package : The term 'Get-WindowsFeature' is not recognized as the name of a cmdlet, function, script file, or operable program.  

To here's a third method that does the same thing, with a little custom prose.

Note that with the following method, "Hyper-V Isolation" doesn't work, which is the default on Windows 10. So the following switch will be required (or set it as the default):

docker run --isolation process  
  • Windows 10 Docker

Pick a Docker version from this list:

https://dockermsft.blob.core.windows.net/dockercontainer/DockerMsftIndex.json  

At the time of writing, this is the most recent one:
https://dockermsft.blob.core.windows.net/dockercontainer/docker-19-03-1.zip

Download and extract, either manually or using PowerShell:

Invoke-WebRequest -UseBasicParsing -OutFile docker-19-03-1.zip https://dockermsft.blob.core.windows.net/dockercontainer/docker-19-03-1.zip

Expand-Archive docker-19-03-1.zip -DestinationPath $Env:ProgramFiles -Force  

Install Docker as a Windows Service and start it. Go to the Docker install location (using the above, under "C:\Program Files\docker"):

.\dockerd.exe --register-service

Start-Service Docker  

Add the install location to the system PATH, and we can now run docker (as administrator):

> docker --version
Docker version 19.03.1, build f660560464  

(Optional) Allow non-admins to execute Docker commands

Admin mode is required to run Docker commands. The following can be used to allow non-admins to do the same.
https://github.com/tfenster/dockeraccesshelper

$account = $(whoami)

$fullControl =[System.Security.AccessControl.FileSystemRights]::FullControl
$allow =[System.Security.AccessControl.AccessControlType]::Allow

$pipe_windows = $true
try {  
    $ps = (docker -H npipe:////./pipe/docker_engine_windows ps) 2> $null
    if ($LASTEXITCODE -ne 0) {
        $pipe_windows = $false
    }
} catch{
    $pipe_windows = $false
}

if (-not $pipe_windows) {  
    $pipe_non_windows = $true
    try {
        $ps = (docker -H npipe:////./pipe/docker_engine ps) 2> $null
        if ($LASTEXITCODE -ne 0) {
            $pipe_non_windows = $false
        }
    } catch{
        $pipe_non_windows = $false
    }
}

if (-not $pipe_windows -and -not $pipe_non_windows) {  
    Write-Host "Unable to reach the Docker engine. Are your sure Docker is running and reachable?"
    return
}

$npipe = "\\.\pipe\docker_engine"
if ($pipe_windows) {  
    $npipe = "\\.\pipe\docker_engine_windows"
}

$dInfo = New-Object "System.IO.DirectoryInfo" -ArgumentList $npipe
$dSec = $dInfo.GetAccessControl()
$rule = New-Object "System.Security.AccessControl.FileSystemAccessRule" -ArgumentList $account,$fullControl,$allow
$dSec.AddAccessRule($rule)
$dInfo.SetAccessControl($dSec)

Appendix

This is how the package source url was obtained:

# Custom package provider, allows PowerShell to install Docker from different sources
# https://github.com/OneGet/MicrosoftDockerProvider
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force

# Execute the command that may fail on Windows 10, but echos the package source
Install-Package -Name docker -ProviderName DockerMsftProvider -Verbose