File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ FROM golang:1.8-nanoserver
22
33SHELL ["powershell" , "-Command" , "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';" ]
44
5- ENV GIT_VERSION 2.12.0
6- ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}.windows.1 /MinGit-${GIT_VERSION}-64-bit.zip
7- ENV GIT_SHA256 6238f65c4d8412b993cb092efde4954f8cb7da4def54d0c1533835f00e83fdad
5+ ENV GIT_VERSION 2.12.2
6+ ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}.windows.2 /MinGit-${GIT_VERSION}.2 -64-bit.zip
7+ ENV GIT_SHA256 3918cd9ab42c9a22aa3934463fdb536485c84e6876e9aaab74003deb43a08a36
88
99RUN Invoke-WebRequest -UseBasicParsing $env:GIT_DOWNLOAD_URL -OutFile git.zip; \
1010 if ((Get-FileHash git.zip -Algorithm sha256).Hash -ne $env:GIT_SHA256) {exit 1} ; \
Original file line number Diff line number Diff line change 1+ FROM golang:1.8-windowsservercore AS build
2+ RUN mv /go /go1.8.1
3+ WORKDIR /
4+ RUN git clone https://github.com/golang/go
5+ WORKDIR /go/src
6+ ENV GOROOT_BOOTSTRAP C:/go1.8.1
7+ ENV CGO_ENABLED 0
8+ RUN cmd /C make.bat
9+
10+ FROM microsoft/nanoserver
11+ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
12+ ENV GOPATH C:\\gopath
13+ RUN $newPath = ('{0}\bin;C:\go\bin;{1}' -f $env:GOPATH, $env:PATH); \
14+ Write-Host ('Updating PATH: {0}' -f $newPath); \
15+ setx /M PATH $newPath;
16+ COPY --from=build /go /go
17+ WORKDIR $GOPATH
18+
19+ ENV GIT_VERSION 2.12.2
20+ ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}.windows.2/MinGit-${GIT_VERSION}.2-64-bit.zip
21+ ENV GIT_SHA256 3918cd9ab42c9a22aa3934463fdb536485c84e6876e9aaab74003deb43a08a36
22+
23+ RUN Invoke-WebRequest -UseBasicParsing $env:GIT_DOWNLOAD_URL -OutFile git.zip; \
24+ if ((Get-FileHash git.zip -Algorithm sha256).Hash -ne $env:GIT_SHA256) {exit 1} ; \
25+ Expand-Archive git.zip -DestinationPath C:\git; \
26+ Remove-Item git.zip; \
27+ Write-Host 'Updating PATH ...'; \
28+ $env:PATH = 'C:\git\cmd;C:\git\mingw64\bin;C:\git\usr\bin;' + $env:PATH; \
29+ Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH
Original file line number Diff line number Diff line change 1+ . $PSScriptRoot \..\update-docker - ce.ps1
2+
13docker build - t golang .
4+ docker build - t golang:devel -f Dockerfile.devel .
Original file line number Diff line number Diff line change @@ -2,3 +2,6 @@ docker tag golang stefanscherer/golang-windows:1.8
22docker tag golang stefanscherer/ golang- windows
33docker push stefanscherer/ golang- windows:1.8
44docker push stefanscherer/ golang- windows
5+
6+ docker tag golang:devel stefanscherer/ golang- windows:devel
7+ docker push stefanscherer/ golang- windows:devel
Original file line number Diff line number Diff line change 1+ Write-Host Testing golang image
12docker run golang go version
23docker run golang git -- version
4+
5+ Write-Host Testing golang:devel image
6+ docker run golang:devel go version
7+ docker run golang:devel git -- version
You can’t perform that action at this time.
0 commit comments