Browse code

Windows dockerfile: Changes to support git 2.10.1

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2016/10/22 11:56:16
Showing 1 changed files
... ...
@@ -106,6 +106,12 @@
106 106
 # The downloaded files are not cleared from the image. go.zip is used by the Windows
107 107
 # CI servers to ensure the host and image are running consistent versions of go.
108 108
 #
109
+# The GIT installer isn't very good at unattended install. We use techniques described
110
+# at the links below to force it to set the path and other options accordingly. 
111
+# >> http://superuser.com/questions/944576/git-for-windows-silent-install-silent-arguments 
112
+# and follow through to installer at
113
+# >> https://github.com/ferventcoder/chocolatey-packages/blob/master/automatic/git.install/tools/chocolateyInstall.ps1
114
+
109 115
 
110 116
 # -----------------------------------------------------------------------------------------
111 117
 
... ...
@@ -116,14 +122,14 @@ FROM microsoft/windowsservercore
116 116
 #  - GO_VERSION must consistent with 'Dockerfile' used by Linux'.
117 117
 #  - FROM_DOCKERFILE is used for detection of building within a container.
118 118
 ENV GO_VERSION=1.7.3 `
119
-    GIT_LOCATION=https://github.com/git-for-windows/git/releases/download/v2.7.2.windows.1/Git-2.7.2-64-bit.exe `
119
+    GIT_LOCATION=https://github.com/git-for-windows/git/releases/download/v2.10.1.windows.1/Git-2.10.1-64-bit.exe `
120 120
     GOPATH=C:/go;C:/go/src/github.com/docker/docker/vendor `
121 121
     FROM_DOCKERFILE=1
122 122
 
123 123
 WORKDIR c:/
124 124
 
125 125
 RUN `
126
- setx /M Path "c:\git\cmd;c:\git\bin;c:\git\usr\bin;%Path%;c:\gcc\bin;c:\go\bin;" && `
126
+ setx /M Path "%Path%;c:\gcc\bin;c:\go\bin;" && `
127 127
  setx GOROOT "c:\go" && `
128 128
  powershell -command `
129 129
   $ErrorActionPreference = 'Stop'; `
... ...
@@ -147,6 +153,13 @@ RUN `
147 147
   Download-File https://raw.githubusercontent.com/jhowardmsft/docker-tdmgcc/master/binutils.zip binutils.zip; `
148 148
   `
149 149
   Write-Host INFO: Installing git...; `
150
+  $installPath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'; `
151
+  $installItem = 'Git_is1'; `
152
+  New-Item -Path $installPath -Name $installItem -Force; `
153
+  $installKey = $installPath+'\'+$installItem; `
154
+  New-ItemProperty $installKey -Name 'Inno Setup CodeFile: Path Option' -Value 'CmdTools' -PropertyType 'String' -Force; `
155
+  New-ItemProperty $installKey -Name 'Inno Setup CodeFile: Bash Terminal Option' -Value 'ConHost' -PropertyType 'String' -Force; `
156
+  New-ItemProperty $installKey -Name 'Inno Setup CodeFile: CRLF Option' -Value 'CRLFCommitAsIs' -PropertyType 'String' -Force; `
150 157
   Start-Process gitsetup.exe -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES /CLOSEAPPLICATIONS /DIR=c:\git\' -Wait; `
151 158
   `
152 159
   Write-Host INFO: Expanding go..."; `