From b275a9bee4e8651af3e6ed318fa3814cb4ee7b79 Mon Sep 17 00:00:00 2001 From: Michael Friis Date: Thu, 14 Apr 2016 14:55:46 -0700 Subject: [PATCH 1/3] Add Windows Dockerfile --- 1.6/Dockerfile.windows | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 1.6/Dockerfile.windows diff --git a/1.6/Dockerfile.windows b/1.6/Dockerfile.windows new file mode 100644 index 00000000..d57f41cd --- /dev/null +++ b/1.6/Dockerfile.windows @@ -0,0 +1,12 @@ +FROM windowsservercore + +ENV GOLANG_VERSION 1.6.1 +ENV GOLANG_DOWNLOAD_URL "https://golang.org/dl/go$GOLANG_VERSION.windows-amd64.zip" + +RUN powershell -Command \ + (New-Object System.Net.WebClient).DownloadFile('%GOLANG_DOWNLOAD_URL%', 'go.zip') ; \ + Expand-Archive go.zip -DestinationPath c:\\ ; \ + Remove-Item go.zip -Force + +RUN setx /M PATH "C:\go\bin;%PATH%" && \ + setx /M GOPATH "C:\go" From 935d6dbb336ad7ea719055eb48cbfa8a2369d01c Mon Sep 17 00:00:00 2001 From: Michael Friis Date: Thu, 14 Apr 2016 15:19:01 -0700 Subject: [PATCH 2/3] set ErrorActionPreference --- 1.6/Dockerfile.windows | 1 + 1 file changed, 1 insertion(+) diff --git a/1.6/Dockerfile.windows b/1.6/Dockerfile.windows index d57f41cd..fc50e3ab 100644 --- a/1.6/Dockerfile.windows +++ b/1.6/Dockerfile.windows @@ -4,6 +4,7 @@ ENV GOLANG_VERSION 1.6.1 ENV GOLANG_DOWNLOAD_URL "https://golang.org/dl/go$GOLANG_VERSION.windows-amd64.zip" RUN powershell -Command \ + $ErrorActionPreference = 'Stop'; \ (New-Object System.Net.WebClient).DownloadFile('%GOLANG_DOWNLOAD_URL%', 'go.zip') ; \ Expand-Archive go.zip -DestinationPath c:\\ ; \ Remove-Item go.zip -Force From 54f4aa49e57cb0104346f27583414af8d436af45 Mon Sep 17 00:00:00 2001 From: Michael Friis Date: Fri, 15 Apr 2016 08:37:35 -0700 Subject: [PATCH 3/3] check hash --- 1.6/Dockerfile.windows | 2 ++ 1 file changed, 2 insertions(+) diff --git a/1.6/Dockerfile.windows b/1.6/Dockerfile.windows index fc50e3ab..786129fa 100644 --- a/1.6/Dockerfile.windows +++ b/1.6/Dockerfile.windows @@ -2,10 +2,12 @@ FROM windowsservercore ENV GOLANG_VERSION 1.6.1 ENV GOLANG_DOWNLOAD_URL "https://golang.org/dl/go$GOLANG_VERSION.windows-amd64.zip" +ENV GOLANG_DOWNLOAD_SHA256 "1505afbcc5f71598c6ffd2a56ad550e4e8728c05649e9085f725e38d6b5a0fb8" RUN powershell -Command \ $ErrorActionPreference = 'Stop'; \ (New-Object System.Net.WebClient).DownloadFile('%GOLANG_DOWNLOAD_URL%', 'go.zip') ; \ + if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $env:GOLANG_DOWNLOAD_SHA256) {exit 1} ; \ Expand-Archive go.zip -DestinationPath c:\\ ; \ Remove-Item go.zip -Force