From 35202805d9a73b362a11dfd3a8f60185668328c8 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Tue, 11 Sep 2018 17:03:58 -0700 Subject: [PATCH] use nanoserver as base --- docker/Dockerfile.windows.1709 | 10 +++++++--- docker/Dockerfile.windows.1803 | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/docker/Dockerfile.windows.1709 b/docker/Dockerfile.windows.1709 index e90736b..1faea53 100644 --- a/docker/Dockerfile.windows.1709 +++ b/docker/Dockerfile.windows.1709 @@ -5,10 +5,14 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl Invoke-WebRequest -UseBasicParsing https://github.com/git-for-windows/git/releases/download/v2.19.0-rc2.windows.1/MinGit-2.19.0.rc2.windows.1-64-bit.zip -OutFile git.zip; \ Expand-Archive git.zip -DestinationPath C:\git -FROM microsoft/windowsservercore:1709 +FROM microsoft/powershell:nanoserver-1709 COPY --from=git /git /git ADD windows/* /bin/ -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -CMD [ "powershell", "C:\\bin\\clone.ps1" ] +# https://github.com/PowerShell/PowerShell/issues/6211#issuecomment-367477137 +USER ContainerAdministrator +RUN setx /M PATH "%PATH%;C:\Program Files\PowerShell" + +SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] +CMD [ "pwsh", "C:\\bin\\clone.ps1" ] diff --git a/docker/Dockerfile.windows.1803 b/docker/Dockerfile.windows.1803 index 5b81ab6..59b4ff2 100644 --- a/docker/Dockerfile.windows.1803 +++ b/docker/Dockerfile.windows.1803 @@ -5,10 +5,14 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl Invoke-WebRequest -UseBasicParsing https://github.com/git-for-windows/git/releases/download/v2.19.0-rc2.windows.1/MinGit-2.19.0.rc2.windows.1-64-bit.zip -OutFile git.zip; \ Expand-Archive git.zip -DestinationPath C:\git -FROM microsoft/windowsservercore:1803 +FROM microsoft/powershell:nanoserver-1803 COPY --from=git /git /git ADD windows/* /bin/ -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -CMD [ "powershell", "C:\\bin\\clone.ps1" ] +# https://github.com/PowerShell/PowerShell/issues/6211#issuecomment-367477137 +USER ContainerAdministrator +RUN setx /M PATH "%PATH%;C:\Program Files\PowerShell" + +SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] +CMD [ "pwsh", "C:\\bin\\clone.ps1" ]