Skip to content

Commit

Permalink
Get 668e326 and other Windows fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mebersol committed Feb 25, 2016
1 parent f6ba898 commit 61175c8
Showing 1 changed file with 44 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ Install-ContainerHost
{
$imageName = "WindowsServerCore"

if (Test-Nano)
if ($HyperV -or Test-Nano)
{
$imageName = "NanoServer"
}
Expand Down Expand Up @@ -535,24 +535,7 @@ Install-ContainerHost
}

Write-Output "Container base image install complete. Querying container images..."
$newBaseImages += Get-InstalledContainerImage $imageName

while ($newBaseImages.Count -eq 0)
{
#
# Sleeping to ensure VMMS has restarted to workaround TP3 issue
#
Write-Output "Waiting for VMMS to return image at ($(get-date))..."

Start-Sleep -Sec 2

$newBaseImages += Get-InstalledContainerImage $imageName
}

if ($newBaseImages.Count -eq 0)
{
throw "No Container OS image installed!"
}
$newBaseImages += Wait-InstalledContainerImage $imageName
}

#
Expand Down Expand Up @@ -647,7 +630,7 @@ Install-ContainerHost
}

Write-Output "Configuring NSSM for $global:DockerServiceName service..."
Start-Process -Wait "nssm" -ArgumentList "install $global:DockerServiceName $($env:SystemRoot)\System32\cmd.exe /s /c $dockerDaemonScript"
Start-Process -Wait "nssm" -ArgumentList "install $global:DockerServiceName $($env:SystemRoot)\System32\cmd.exe /s /c $dockerDaemonScript < nul"
Start-Process -Wait "nssm" -ArgumentList "set $global:DockerServiceName DisplayName Docker Daemon"
Start-Process -Wait "nssm" -ArgumentList "set $global:DockerServiceName Description The Docker Daemon provides management capabilities of containers for docker clients"
# Pipe output to daemon.log
Expand Down Expand Up @@ -922,7 +905,11 @@ Test-Nano()
{
$EditionId = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name 'EditionID').EditionId

return (($EditionId -eq "NanoServer") -or ($EditionId -eq "ServerTuva"))
return (($EditionId -eq "ServerStandardNano ") -or
($EditionId -eq "ServerDataCenterNano") -or
($EditionId -eq "NanoServer") -or
($EditionId -eq "ServerTuva"))

}


Expand Down Expand Up @@ -1026,6 +1013,42 @@ Test-Docker()
}


function
Wait-InstalledContainerImage
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
[ValidateNotNullOrEmpty()]
$BaseImageName
)

$newBaseImages = Get-InstalledContainerImage $BaseImageName

while ($newBaseImages.Count -eq 0)
{
$timeElapsed = $(Get-Date) - $startTime

if ($($timeElapsed).TotalMinutes -gt 5)
{
throw "Image $BaseImageName not found after 5 minutes"
}

#
# Sleeping to ensure VMMS has restarted to workaround TP3 issue
#
Write-Output "Waiting for VMMS to return image at ($(get-date))..."

Start-Sleep -Sec 2

$newBaseImages += Get-InstalledContainerImage $BaseImageName
}

return $newBaseImages
}


function
Wait-Docker()
{
Expand Down

1 comment on commit 61175c8

@mebersol
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, there's a bug there. Fix coming shortly

Please sign in to comment.