Przeglądaj źródła

Merge pull request #22082 from tiborvass/revert-go-security-fix-for-windows

Workaround Windows bug discovered with Go security fix
Alexander Morozov 9 lat temu
rodzic
commit
1cd7dd8917
2 zmienionych plików z 16 dodań i 0 usunięć
  1. 10 0
      Dockerfile
  2. 6 0
      hack/make/cross

+ 10 - 0
Dockerfile

@@ -129,6 +129,16 @@ RUN set -x \
 ENV GO_VERSION 1.5.4
 ENV GO_VERSION 1.5.4
 RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" \
 RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" \
 	| tar -xzC /usr/local
 	| tar -xzC /usr/local
+
+# !!! TEMPORARY HACK !!!
+# Because of https://github.com/golang/go/issues/15286 we have to revert to Go 1.5.3 for windows/amd64 in master
+# To change which version of Go to compile with, simply prepend PATH with /usr/local/go1.5.3/bin
+# and set GOROOT to /usr/local/go1.5.3
+ENV HACK_GO_VERSION 1.5.3
+RUN curl -fsSL "https://storage.googleapis.com/golang/go${HACK_GO_VERSION}.linux-amd64.tar.gz" \
+	| tar -xzC /tmp \
+	&& mv /tmp/go "/usr/local/go${HACK_GO_VERSION}"
+
 ENV PATH /go/bin:/usr/local/go/bin:$PATH
 ENV PATH /go/bin:/usr/local/go/bin:$PATH
 ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
 ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
 
 

+ 6 - 0
hack/make/cross

@@ -29,6 +29,12 @@ for platform in $DOCKER_CROSSPLATFORMS; do
 			export LDFLAGS_STATIC_DOCKER="" # we just need a simple client for these platforms
 			export LDFLAGS_STATIC_DOCKER="" # we just need a simple client for these platforms
 			export BUILDFLAGS=( "${ORIG_BUILDFLAGS[@]/ daemon/}" ) # remove the "daemon" build tag from platforms that aren't supported
 			export BUILDFLAGS=( "${ORIG_BUILDFLAGS[@]/ daemon/}" ) # remove the "daemon" build tag from platforms that aren't supported
 		fi
 		fi
+		# !!! TEMPORARY HACK !!!
+		# See Dockerfile
+		if [ "$platform" == "windows/amd64" ]; then
+			export GOROOT="/usr/local/go${HACK_GO_VERSION}"
+			export PATH=$(echo "$PATH" | sed "s,:/usr/local/go/bin:,:/usr/local/go${HACK_GO_VERSION}/bin:,")
+		fi
 		source "${MAKEDIR}/binary"
 		source "${MAKEDIR}/binary"
 	)
 	)
 done
 done