Pull docker images in background, write minimal progress

Signed-off-by: default avatarStefan Scherer <scherer_stefan@icloud.com>
parent ed5eb7e0
function DockerPull {
Param ([string]$image)
Write-Host Installing $image ...
$j = Start-Job -ScriptBlock { docker pull $image }
while ( $j.JobStateInfo.state -ne "Completed" ) {
Write-Host $j.JobStateInfo.state
Start-Sleep 10
}
$results = Receive-Job -Job $j
$results
}
DockerPull microsoft/windowsservercore
DockerPull microsoft/nanoserver
......@@ -14,9 +14,3 @@ Write-Host "Fix --restart=always for reboot ..."
& sc.exe config Docker depend= LanmanWorkstation
Start-Service Docker
Write-Host "Installing WindowsServerCore container image..."
& "C:\Program Files\docker\docker.exe" pull microsoft/windowsservercore
Write-Host "Installing NanoServer container image..."
& "C:\Program Files\docker\docker.exe" pull microsoft/nanoserver
......@@ -142,6 +142,7 @@
"scripts": [
"./scripts/docker/add-docker-group.ps1",
"./scripts/docker/install-docker.ps1",
"./scripts/docker/docker-pull-async.ps1",
"./scripts/docker/open-docker-insecure-port.ps1",
"./scripts/docker/remove-docker-key-json.ps1",
"./scripts/docker/disable-windows-defender.ps1"
......
......@@ -53,7 +53,9 @@
"type": "powershell",
"scripts": [
"./scripts/docker/add-docker-group.ps1",
"./scripts/docker/disable-windows-defender.ps1",
"./scripts/docker/install-docker.ps1",
"./scripts/docker/docker-pull-async.ps1",
"./scripts/docker/remove-docker-key-json.ps1"
]
}
......
......@@ -61,6 +61,7 @@
"scripts": [
"./scripts/docker/add-docker-group.ps1",
"./scripts/docker/install-docker.ps1",
"./scripts/docker/docker-pull-async.ps1",
"./scripts/docker/open-docker-insecure-port.ps1",
"./scripts/docker/remove-docker-key-json.ps1",
"./scripts/docker/disable-windows-defender.ps1"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment