Skip to content

Instantly share code, notes, and snippets.

@riezebosch
Last active April 5, 2018 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riezebosch/b683ef501f35050abf5fdd6a86926bb9 to your computer and use it in GitHub Desktop.
Save riezebosch/b683ef501f35050abf5fdd6a86926bb9 to your computer and use it in GitHub Desktop.
$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