Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$ErrorActionPreference = "Stop"
if ((Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V -Online).State -ne 'Enabled') {
Enable-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V -Online -All -NoRestart
}
if ((Get-WindowsOptionalFeature -FeatureName Containers -Online).State -ne 'Enabled') {
Enable-WindowsOptionalFeature -FeatureName Containers -Online -All -NoRestart
}
if (!(Test-Path dockerd.exe)) {
Start-BitsTransfer -Destination dockerd.exe -Source https://master.dockerproject.org/windows/x86_64/dockerd.exe
}
if (!(Test-Path docker.exe)) {
Start-BitsTransfer -Destination docker.exe -Source https://master.dockerproject.org/windows/x86_64/docker.exe
}
if (!(Test-Path release.zip)) {
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
$wc = New-Object System.Net.WebClient
$wc.DownloadFile('https://github.com/linuxkit/lcow/releases/download/4.14.29-0aea33bc/release.zip', "$PSScriptRoot\release.zip")
}
Remove-Item "$env:ProgramFiles\Linux Containers" -Force -Recurse
Expand-Archive release.zip -DestinationPath "$Env:ProgramFiles\Linux Containers\."
#rm release.zip
.\dockerd.exe -D --experimental
docker run --platform linux --rm -ti busybox sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.