From ef634b95f4b034fac073c347e791a0974bf76f2a Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Fri, 23 Sep 2016 23:24:20 +0100 Subject: [PATCH] Patch Go with fix for OSX Sierra Backport this patch to the Go 1.6.3 runtime needed for OSX Sierra. Signed-off-by: Justin Cormack --- Dockerfile | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 690880990d..5ee7e7d908 100644 --- a/Dockerfile +++ b/Dockerfile @@ -121,11 +121,6 @@ RUN set -x \ # will need updating, to avoid errors. Ping #docker-maintainers on IRC # with a heads-up. ENV GO_VERSION 1.6.3 -RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" \ - | tar -xzC /usr/local - -ENV PATH /go/bin:/usr/local/go/bin:$PATH -ENV GOPATH /go:/go/src/github.com/docker/docker/vendor # Compile Go for cross compilation ENV DOCKER_CROSSPLATFORMS \ @@ -134,6 +129,20 @@ ENV DOCKER_CROSSPLATFORMS \ freebsd/amd64 freebsd/386 freebsd/arm \ windows/amd64 windows/386 +RUN curl -fsSL "https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz" \ + | tar -xzC /root && \ + mv /root/go /root/go1.4 && \ + cd /usr/local && \ + curl -fsSL "https://storage.googleapis.com/golang/go$GO_VERSION.src.tar.gz" \ + | tar -xzC /usr/local && \ + cd go && \ + printf 'diff --git a/src/runtime/sys_darwin_amd64.s b/src/runtime/sys_darwin_amd64.s\nindex e09b906..fa8ff2f 100644\n--- a/src/runtime/sys_darwin_amd64.s\n+++ b/src/runtime/sys_darwin_amd64.s\n@@ -157,6 +157,7 @@ systime:\n\t// Fall back to system call (usually first call in this thread).\n\tMOVQ\tSP, DI\n\tMOVQ\t$0, SI\n+\tMOVQ\t$0, DX // required as of Sierra; Issue 16570\n\tMOVL\t$(0x2000000+116), AX\n\tSYSCALL\n\tCMPQ\tAX, $0\n' | patch -p1 && \ + cd src && \ + ./make.bash + +ENV PATH /go/bin:/usr/local/go/bin:$PATH +ENV GOPATH /go:/go/src/github.com/docker/docker/vendor + # This has been commented out and kept as reference because we don't support compiling with older Go anymore. # ENV GOFMT_VERSION 1.3.3 # RUN curl -sSL https://storage.googleapis.com/golang/go${GOFMT_VERSION}.$(go env GOOS)-$(go env GOARCH).tar.gz | tar -C /go/bin -xz --strip-components=2 go/bin/gofmt