Skip to content

Conversation

@tianon
Copy link
Member Author

tianon commented Aug 15, 2016

Since we can't really run test-pr.sh on this:

$ bashbrew build --namespace test https://raw.githubusercontent.com/infosiftr/stackbrew/d5b1a9a9186432036d445f5b1a2cd94f96c7a75b/library/golang
skipping "golang:1.5.4" (due to exclusive constraints)
skipping "golang:1.5.4-onbuild" (due to exclusive constraints)
skipping "golang:1.5.4-wheezy" (due to exclusive constraints)
skipping "golang:1.5.4-alpine" (due to exclusive constraints)
Building bashbrew/cache:a1a28cac5c41579a58bc1d5b9d574847548eaf0036cce3c9cfe57f0fdd776313 (golang:1.5.4-windowsservercore)
Tagging test/golang:1.5.4-windowsservercore
Tagging test/golang:1.5-windowsservercore
skipping "golang:1.6.3" (due to exclusive constraints)
skipping "golang:1.6.3-onbuild" (due to exclusive constraints)
skipping "golang:1.6.3-wheezy" (due to exclusive constraints)
skipping "golang:1.6.3-alpine" (due to exclusive constraints)
Building bashbrew/cache:f0bc69053c82756d3c0b075741dc9b6bee62620e9d156353e239b9527eedf0b2 (golang:1.6.3-windowsservercore)
Tagging test/golang:1.6.3-windowsservercore
Tagging test/golang:1.6-windowsservercore
Tagging test/golang:1-windowsservercore
Tagging test/golang:windowsservercore
skipping "golang:1.7rc6" (due to exclusive constraints)
skipping "golang:1.7rc6-onbuild" (due to exclusive constraints)
skipping "golang:1.7rc6-wheezy" (due to exclusive constraints)
skipping "golang:1.7rc6-alpine" (due to exclusive constraints)
Building bashbrew/cache:29cc5bb3dd64ace7226f1520e533dc2deb7953335c47130735e878c585e564c7 (golang:1.7rc6-windowsservercore)
Tagging test/golang:1.7rc6-windowsservercore
Tagging test/golang:1.7-windowsservercore

@tianon
Copy link
Member Author

tianon commented Aug 15, 2016

diff --git a/golang_1.5-windowsservercore/Dockerfile b/golang_1.5-windowsservercore/Dockerfile
new file mode 100644
index 0000000..70ab39b
--- /dev/null
+++ b/golang_1.5-windowsservercore/Dockerfile
@@ -0,0 +1,85 @@
+FROM microsoft/windowsservercore
+
+SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
+
+# install Git (especially for "go get")
+ENV GIT_VERSION 2.9.2
+ENV GIT_TAG v${GIT_VERSION}.windows.1
+ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/${GIT_TAG}/Git-${GIT_VERSION}-64-bit.exe
+ENV GIT_DOWNLOAD_SHA256 006d971bcbe73cc8d841a100a4eb20d22e135142bf5b0f2120722fd420e166e5
+# steps inspired by "chcolateyInstall.ps1" from "git.install" (https://chocolatey.org/packages/git.install)
+RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \
+   (New-Object System.Net.WebClient).DownloadFile($env:GIT_DOWNLOAD_URL, 'git.exe'); \
+   \
+   Write-Host ('Verifying sha256 ({0}) ...' -f $env:GIT_DOWNLOAD_SHA256); \
+   if ((Get-FileHash git.exe -Algorithm sha256).Hash -ne $env:GIT_DOWNLOAD_SHA256) { \
+       Write-Host 'FAILED!'; \
+       exit 1; \
+   }; \
+   \
+   Write-Host 'Installing ...'; \
+   Start-Process \
+       -Wait \
+       -FilePath ./git.exe \
+# http://www.jrsoftware.org/ishelp/topic_setupcmdline.htm
+       -ArgumentList @( \
+           '/VERYSILENT', \
+           '/NORESTART', \
+           '/NOCANCEL', \
+           '/SP-', \
+           '/SUPPRESSMSGBOXES', \
+           \
+# https://github.com/git-for-windows/build-extra/blob/353f965e0e2af3e8c993930796975f9ce512c028/installer/install.iss#L87-L96
+           '/COMPONENTS=assoc_sh', \
+           \
+# set "/DIR" so we can set "PATH" afterwards
+# see https://disqus.com/home/discussion/chocolatey/chocolatey_gallery_git_install_1710/#comment-2834659433 for why we don't use "/LOADINF=..." to let the installer set PATH
+           '/DIR=C:\git' \
+       ); \
+   \
+   Write-Host 'Updating PATH ...'; \
+   $env:PATH = 'C:\git\bin;C:\git\mingw64\bin;C:\git\usr\bin;' + $env:PATH; \
+   [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
+   \
+   Write-Host 'Verifying install ...'; \
+   Write-Host '  git --version'; git --version; \
+   Write-Host '  bash --version'; bash --version; \
+   Write-Host '  curl --version'; curl.exe --version; \
+   \
+   Write-Host 'Removing installer ...'; \
+   Remove-Item git.exe -Force; \
+   \
+   Write-Host 'Complete.';
+
+# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows
+ENV GOPATH C:\\gopath
+
+# PATH isn't actually set in the Docker image, so we have to set it from within the container
+RUN [Environment]::SetEnvironmentVariable('PATH', $env:GOPATH + '\bin;C:\go\bin;' + $env:PATH, [EnvironmentVariableTarget]::Machine);
+# doing this first to share cache across versions more aggressively
+
+ENV GOLANG_VERSION 1.5.4
+ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.windows-amd64.zip
+ENV GOLANG_DOWNLOAD_SHA256 1201053d5659a5fc5c82dff58c3eaee66ecd02901621725cfdfff1681278bd1a
+
+RUN Write-Host ('Downloading {0} ...' -f $env:GOLANG_DOWNLOAD_URL); \
+   (New-Object System.Net.WebClient).DownloadFile($env:GOLANG_DOWNLOAD_URL, 'go.zip'); \
+   \
+   Write-Host ('Verifying sha256 ({0}) ...' -f $env:GOLANG_DOWNLOAD_SHA256); \
+   if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $env:GOLANG_DOWNLOAD_SHA256) { \
+       Write-Host 'FAILED!'; \
+       exit 1; \
+   }; \
+   \
+   Write-Host 'Expanding ...'; \
+   Expand-Archive go.zip -DestinationPath C:\; \
+   \
+   Write-Host 'Verifying install ("go version") ...'; \
+   go version; \
+   \
+   Write-Host 'Removing ...'; \
+   Remove-Item go.zip -Force; \
+   \
+   Write-Host 'Complete.';
+
+WORKDIR $GOPATH
diff --git a/golang_1.7-windowsservercore/Dockerfile b/golang_1.7-windowsservercore/Dockerfile
new file mode 100644
index 0000000..b135ed9
--- /dev/null
+++ b/golang_1.7-windowsservercore/Dockerfile
@@ -0,0 +1,85 @@
+FROM microsoft/windowsservercore
+
+SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
+
+# install Git (especially for "go get")
+ENV GIT_VERSION 2.9.2
+ENV GIT_TAG v${GIT_VERSION}.windows.1
+ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/${GIT_TAG}/Git-${GIT_VERSION}-64-bit.exe
+ENV GIT_DOWNLOAD_SHA256 006d971bcbe73cc8d841a100a4eb20d22e135142bf5b0f2120722fd420e166e5
+# steps inspired by "chcolateyInstall.ps1" from "git.install" (https://chocolatey.org/packages/git.install)
+RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \
+   (New-Object System.Net.WebClient).DownloadFile($env:GIT_DOWNLOAD_URL, 'git.exe'); \
+   \
+   Write-Host ('Verifying sha256 ({0}) ...' -f $env:GIT_DOWNLOAD_SHA256); \
+   if ((Get-FileHash git.exe -Algorithm sha256).Hash -ne $env:GIT_DOWNLOAD_SHA256) { \
+       Write-Host 'FAILED!'; \
+       exit 1; \
+   }; \
+   \
+   Write-Host 'Installing ...'; \
+   Start-Process \
+       -Wait \
+       -FilePath ./git.exe \
+# http://www.jrsoftware.org/ishelp/topic_setupcmdline.htm
+       -ArgumentList @( \
+           '/VERYSILENT', \
+           '/NORESTART', \
+           '/NOCANCEL', \
+           '/SP-', \
+           '/SUPPRESSMSGBOXES', \
+           \
+# https://github.com/git-for-windows/build-extra/blob/353f965e0e2af3e8c993930796975f9ce512c028/installer/install.iss#L87-L96
+           '/COMPONENTS=assoc_sh', \
+           \
+# set "/DIR" so we can set "PATH" afterwards
+# see https://disqus.com/home/discussion/chocolatey/chocolatey_gallery_git_install_1710/#comment-2834659433 for why we don't use "/LOADINF=..." to let the installer set PATH
+           '/DIR=C:\git' \
+       ); \
+   \
+   Write-Host 'Updating PATH ...'; \
+   $env:PATH = 'C:\git\bin;C:\git\mingw64\bin;C:\git\usr\bin;' + $env:PATH; \
+   [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
+   \
+   Write-Host 'Verifying install ...'; \
+   Write-Host '  git --version'; git --version; \
+   Write-Host '  bash --version'; bash --version; \
+   Write-Host '  curl --version'; curl.exe --version; \
+   \
+   Write-Host 'Removing installer ...'; \
+   Remove-Item git.exe -Force; \
+   \
+   Write-Host 'Complete.';
+
+# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows
+ENV GOPATH C:\\gopath
+
+# PATH isn't actually set in the Docker image, so we have to set it from within the container
+RUN [Environment]::SetEnvironmentVariable('PATH', $env:GOPATH + '\bin;C:\go\bin;' + $env:PATH, [EnvironmentVariableTarget]::Machine);
+# doing this first to share cache across versions more aggressively
+
+ENV GOLANG_VERSION 1.7rc6
+ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.windows-amd64.zip
+ENV GOLANG_DOWNLOAD_SHA256 f043f7327049340e078ded4f9eed0b811f8cfa1adb7492403d3dea9cfebee13b
+
+RUN Write-Host ('Downloading {0} ...' -f $env:GOLANG_DOWNLOAD_URL); \
+   (New-Object System.Net.WebClient).DownloadFile($env:GOLANG_DOWNLOAD_URL, 'go.zip'); \
+   \
+   Write-Host ('Verifying sha256 ({0}) ...' -f $env:GOLANG_DOWNLOAD_SHA256); \
+   if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $env:GOLANG_DOWNLOAD_SHA256) { \
+       Write-Host 'FAILED!'; \
+       exit 1; \
+   }; \
+   \
+   Write-Host 'Expanding ...'; \
+   Expand-Archive go.zip -DestinationPath C:\; \
+   \
+   Write-Host 'Verifying install ("go version") ...'; \
+   go version; \
+   \
+   Write-Host 'Removing ...'; \
+   Remove-Item go.zip -Force; \
+   \
+   Write-Host 'Complete.';
+
+WORKDIR $GOPATH
diff --git a/golang_windowsservercore/Dockerfile b/golang_windowsservercore/Dockerfile
new file mode 100644
index 0000000..241322c
--- /dev/null
+++ b/golang_windowsservercore/Dockerfile
@@ -0,0 +1,85 @@
+FROM microsoft/windowsservercore
+
+SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
+
+# install Git (especially for "go get")
+ENV GIT_VERSION 2.9.2
+ENV GIT_TAG v${GIT_VERSION}.windows.1
+ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/${GIT_TAG}/Git-${GIT_VERSION}-64-bit.exe
+ENV GIT_DOWNLOAD_SHA256 006d971bcbe73cc8d841a100a4eb20d22e135142bf5b0f2120722fd420e166e5
+# steps inspired by "chcolateyInstall.ps1" from "git.install" (https://chocolatey.org/packages/git.install)
+RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \
+   (New-Object System.Net.WebClient).DownloadFile($env:GIT_DOWNLOAD_URL, 'git.exe'); \
+   \
+   Write-Host ('Verifying sha256 ({0}) ...' -f $env:GIT_DOWNLOAD_SHA256); \
+   if ((Get-FileHash git.exe -Algorithm sha256).Hash -ne $env:GIT_DOWNLOAD_SHA256) { \
+       Write-Host 'FAILED!'; \
+       exit 1; \
+   }; \
+   \
+   Write-Host 'Installing ...'; \
+   Start-Process \
+       -Wait \
+       -FilePath ./git.exe \
+# http://www.jrsoftware.org/ishelp/topic_setupcmdline.htm
+       -ArgumentList @( \
+           '/VERYSILENT', \
+           '/NORESTART', \
+           '/NOCANCEL', \
+           '/SP-', \
+           '/SUPPRESSMSGBOXES', \
+           \
+# https://github.com/git-for-windows/build-extra/blob/353f965e0e2af3e8c993930796975f9ce512c028/installer/install.iss#L87-L96
+           '/COMPONENTS=assoc_sh', \
+           \
+# set "/DIR" so we can set "PATH" afterwards
+# see https://disqus.com/home/discussion/chocolatey/chocolatey_gallery_git_install_1710/#comment-2834659433 for why we don't use "/LOADINF=..." to let the installer set PATH
+           '/DIR=C:\git' \
+       ); \
+   \
+   Write-Host 'Updating PATH ...'; \
+   $env:PATH = 'C:\git\bin;C:\git\mingw64\bin;C:\git\usr\bin;' + $env:PATH; \
+   [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
+   \
+   Write-Host 'Verifying install ...'; \
+   Write-Host '  git --version'; git --version; \
+   Write-Host '  bash --version'; bash --version; \
+   Write-Host '  curl --version'; curl.exe --version; \
+   \
+   Write-Host 'Removing installer ...'; \
+   Remove-Item git.exe -Force; \
+   \
+   Write-Host 'Complete.';
+
+# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows
+ENV GOPATH C:\\gopath
+
+# PATH isn't actually set in the Docker image, so we have to set it from within the container
+RUN [Environment]::SetEnvironmentVariable('PATH', $env:GOPATH + '\bin;C:\go\bin;' + $env:PATH, [EnvironmentVariableTarget]::Machine);
+# doing this first to share cache across versions more aggressively
+
+ENV GOLANG_VERSION 1.6.3
+ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.windows-amd64.zip
+ENV GOLANG_DOWNLOAD_SHA256 6a18e5ed8b39785338986aecc6a3f36f5c4be286ff52db0ae3bcd2275ab70df0
+
+RUN Write-Host ('Downloading {0} ...' -f $env:GOLANG_DOWNLOAD_URL); \
+   (New-Object System.Net.WebClient).DownloadFile($env:GOLANG_DOWNLOAD_URL, 'go.zip'); \
+   \
+   Write-Host ('Verifying sha256 ({0}) ...' -f $env:GOLANG_DOWNLOAD_SHA256); \
+   if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $env:GOLANG_DOWNLOAD_SHA256) { \
+       Write-Host 'FAILED!'; \
+       exit 1; \
+   }; \
+   \
+   Write-Host 'Expanding ...'; \
+   Expand-Archive go.zip -DestinationPath C:\; \
+   \
+   Write-Host 'Verifying install ("go version") ...'; \
+   go version; \
+   \
+   Write-Host 'Removing ...'; \
+   Remove-Item go.zip -Force; \
+   \
+   Write-Host 'Complete.';
+
+WORKDIR $GOPATH

@yosifkit
Copy link
Member

LGTM

@yosifkit yosifkit merged commit c906527 into docker-library:master Aug 16, 2016
@yosifkit yosifkit deleted the golang-windowsservercore branch August 16, 2016 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants