From 9152d6ba047d99ce9e56fd479e37c3b9bde3c9f3 Mon Sep 17 00:00:00 2001 From: Patrick Lang Date: Tue, 15 May 2018 16:31:14 -0700 Subject: [PATCH] Adding version detect before kubelet/pause container build --- parts/k8s/kuberneteswindowssetup.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/parts/k8s/kuberneteswindowssetup.ps1 b/parts/k8s/kuberneteswindowssetup.ps1 index 20029b4f9f..3762779997 100644 --- a/parts/k8s/kuberneteswindowssetup.ps1 +++ b/parts/k8s/kuberneteswindowssetup.ps1 @@ -216,6 +216,19 @@ function New-InfraContainer() { cd $global:KubeDir + $computerInfo = Get-ComputerInfo + $windowsBase = if ($computerInfo.WindowsVersion -eq "1709") { + "microsoft/nanoserver:1709" + } elseif ( ($computerInfo.WindowsVersion -eq "1803") -and ($computerInfo.WindowsBuildLabEx.StartsWith("17134")) ) { + "microsoft/nanoserver:1803" + } else { + # This is a temporary workaround. As of May 2018, Windows Server Insider builds still report 1803 which is wrong. + # Once that is fixed, add another elseif ( -eq "nnnn") instead and remove the StartsWith("17134") above + "microsoft/nanoserver-insider" + } + + "FROM $($windowsBase)" | Out-File -encoding ascii -FilePath Dockerfile + "CMD cmd /c ping -t localhost" | Out-File -encoding ascii -FilePath Dockerfile -Append docker build -t kubletwin/pause . }