Skip to content

Commit 7cb6105

Browse files
friismtianon
authored andcommitted
check hash
1 parent 7515eff commit 7cb6105

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

1.6/Dockerfile.windows

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ FROM windowsservercore
22

33
ENV GOLANG_VERSION 1.6.1
44
ENV GOLANG_DOWNLOAD_URL "https://golang.org/dl/go$GOLANG_VERSION.windows-amd64.zip"
5+
ENV GOLANG_DOWNLOAD_SHA256 "1505afbcc5f71598c6ffd2a56ad550e4e8728c05649e9085f725e38d6b5a0fb8"
56

67
RUN powershell -Command \
78
$ErrorActionPreference = 'Stop'; \
89
(New-Object System.Net.WebClient).DownloadFile('%GOLANG_DOWNLOAD_URL%', 'go.zip') ; \
10+
if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $env:GOLANG_DOWNLOAD_SHA256) {exit 1} ; \
911
Expand-Archive go.zip -DestinationPath c:\\ ; \
1012
Remove-Item go.zip -Force
1113

0 commit comments

Comments
 (0)