Skip to content

Fix some minor bugs in update.sh and add windowsservercore variants for 1.5 and 1.7 #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2016

Conversation

tianon
Copy link
Member

@tianon tianon commented Aug 12, 2016

Expanding on #106 👍

@tianon
Copy link
Member Author

tianon commented Aug 12, 2016

commit 5064128550ac4d68f8f46a69bac6c84e329efb2e
Author: Tianon Gravi <admwiggin@gmail.com>
Date:   Fri Aug 12 12:12:03 2016 -0700

    Fix some minor bugs in update.sh and add windowsservercore variants for 1.5 and 1.7

diff --git a/1.6/windows/windowsservercore/Dockerfile b/1.5/windows/windowsservercore/Dockerfile
similarity index 91%
copy from 1.6/windows/windowsservercore/Dockerfile
copy to 1.5/windows/windowsservercore/Dockerfile
index 8d33a33..229c696 100644
--- a/1.6/windows/windowsservercore/Dockerfile
+++ b/1.5/windows/windowsservercore/Dockerfile
@@ -13,6 +13,7 @@ RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \
    \
    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; \
    }; \
    \
@@ -51,21 +52,25 @@ ENV GOPATH C:\\gopath
 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_VERSION 1.5.4
 ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.windows-amd64.zip
-ENV GOLANG_DOWNLOAD_SHA256 6a18e5ed8b39785338986aecc6a3f36f5c4be286ff52db0ae3bcd2275ab70df0
+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; \
    \
diff --git a/1.6/windows/windowsservercore/Dockerfile b/1.6/windows/windowsservercore/Dockerfile
index 8d33a33..1b241fa 100644
--- a/1.6/windows/windowsservercore/Dockerfile
+++ b/1.6/windows/windowsservercore/Dockerfile
@@ -13,6 +13,7 @@ RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \
    \
    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; \
    }; \
    \
@@ -60,12 +61,16 @@ RUN Write-Host ('Downloading {0} ...' -f $env:GOLANG_DOWNLOAD_URL); \
    \
    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; \
    \
diff --git a/1.6/windows/windowsservercore/Dockerfile b/1.7/windows/windowsservercore/Dockerfile
similarity index 91%
copy from 1.6/windows/windowsservercore/Dockerfile
copy to 1.7/windows/windowsservercore/Dockerfile
index 8d33a33..f0f19ce 100644
--- a/1.6/windows/windowsservercore/Dockerfile
+++ b/1.7/windows/windowsservercore/Dockerfile
@@ -13,6 +13,7 @@ RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \
    \
    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; \
    }; \
    \
@@ -51,21 +52,25 @@ ENV GOPATH C:\\gopath
 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_VERSION 1.7rc6
 ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.windows-amd64.zip
-ENV GOLANG_DOWNLOAD_SHA256 6a18e5ed8b39785338986aecc6a3f36f5c4be286ff52db0ae3bcd2275ab70df0
+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; \
    \
diff --git a/update.sh b/update.sh
index fe61311..58f3c53 100755
--- a/update.sh
+++ b/update.sh
@@ -40,12 +40,13 @@ for version in "${versions[@]}"; do
    [[ "$versionTag" == *.*[^0-9]* ]] || versionTag+='.0'
    (
        set -x
-       sed -ri '
-           s/^(ENV GOLANG_VERSION) .*/\1 '"$fullVersion"'/;
-           s/^(ENV GOLANG_DOWNLOAD_SHA256) .*/\1 '"$linuxSha256"'/;
-           s/^(ENV GOLANG_SRC_SHA256) .*/\1 '"$srcSha256"'/;
-           s/^(FROM golang):.*/\1:'"$version"'/;
-       ' "$version/Dockerfile" "$version/"*"/Dockerfile"
+       sed -ri \
+           -e 's/^(ENV GOLANG_VERSION) .*/\1 '"$fullVersion"'/' \
+           -e 's/^(ENV GOLANG_DOWNLOAD_SHA256) .*/\1 '"$linuxSha256"'/' \
+           -e 's/^(ENV GOLANG_SRC_SHA256) .*/\1 '"$srcSha256"'/' \
+           -e 's/^(FROM golang):.*/\1:'"$version"'/' \
+           "$version/Dockerfile" \
+           "$version/"*"/Dockerfile"
        cp go-wrapper "$version/"
    )
    for variant in alpine wheezy; do
@@ -64,7 +65,10 @@ for version in "${versions[@]}"; do
        if [ -d "$version/$variant" ]; then
            (
                set -x
-               sed -ri 's/^(ENV GOLANG_DOWNLOAD_SHA256) .*/\1 '"$windowsSha256"'/' "$version/$variant/Dockerfile"
+               sed -ri \
+                   -e 's/^(ENV GOLANG_VERSION) .*/\1 '"$fullVersion"'/' \
+                   -e 's/^(ENV GOLANG_DOWNLOAD_SHA256) .*/\1 '"$windowsSha256"'/' \
+                   "$version/$variant/Dockerfile"
            )
        fi
    done

@tianon tianon force-pushed the moar-windows branch 3 times, most recently from feceb0d to 224f2fc Compare August 12, 2016 22:33
@@ -8,37 +8,41 @@ 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)
# 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
Copy link
Member Author

Choose a reason for hiding this comment

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

LOL GIT

@tianon tianon force-pushed the moar-windows branch 2 times, most recently from 5d6976e to d8bf13c Compare August 12, 2016 22:42
@yosifkit
Copy link
Member

LGTM

@yosifkit yosifkit merged commit 04ba8bf into docker-library:master Aug 12, 2016
@yosifkit yosifkit deleted the moar-windows branch August 12, 2016 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants