Browse code

Workaround Windows bug discovered with Go security fix

For context: https://github.com/golang/go/issues/15286

This commit downloads go1.5.3 in addition to go1.5.4 in order to
workaround the issue.

It is not expected to do a Docker release without a proper fix, however
this should help unblock Docker development on Windows TP5.

Signed-off-by: Tibor Vass <tibor@docker.com>

Tibor Vass authored on 2016/04/16 06:34:24
Showing 2 changed files
... ...
@@ -129,6 +129,16 @@ RUN set -x \
129 129
 ENV GO_VERSION 1.5.4
130 130
 RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" \
131 131
 	| tar -xzC /usr/local
132
+
133
+# !!! TEMPORARY HACK !!!
134
+# Because of https://github.com/golang/go/issues/15286 we have to revert to Go 1.5.3 for windows/amd64 in master
135
+# To change which version of Go to compile with, simply prepend PATH with /usr/local/go1.5.3/bin
136
+# and set GOROOT to /usr/local/go1.5.3
137
+ENV HACK_GO_VERSION 1.5.3
138
+RUN curl -fsSL "https://storage.googleapis.com/golang/go${HACK_GO_VERSION}.linux-amd64.tar.gz" \
139
+	| tar -xzC /tmp \
140
+	&& mv /tmp/go "/usr/local/go${HACK_GO_VERSION}"
141
+
132 142
 ENV PATH /go/bin:/usr/local/go/bin:$PATH
133 143
 ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
134 144
 
... ...
@@ -29,6 +29,12 @@ for platform in $DOCKER_CROSSPLATFORMS; do
29 29
 			export LDFLAGS_STATIC_DOCKER="" # we just need a simple client for these platforms
30 30
 			export BUILDFLAGS=( "${ORIG_BUILDFLAGS[@]/ daemon/}" ) # remove the "daemon" build tag from platforms that aren't supported
31 31
 		fi
32
+		# !!! TEMPORARY HACK !!!
33
+		# See Dockerfile
34
+		if [ "$platform" == "windows/amd64" ]; then
35
+			export GOROOT="/usr/local/go${HACK_GO_VERSION}"
36
+			export PATH=$(echo "$PATH" | sed "s,:/usr/local/go/bin:,:/usr/local/go${HACK_GO_VERSION}/bin:,")
37
+		fi
32 38
 		source "${MAKEDIR}/binary"
33 39
 	)
34 40
 done