From b7b7d784d8007aea0d8cff54c67d19e960cb4639 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 25 May 2017 12:41:56 -0400 Subject: [PATCH] Remove gox, add support for s390x Signed-off-by: Daniel Nephin --- dockerfiles/Dockerfile.cross | 4 ---- dockerfiles/Dockerfile.dev | 4 ---- scripts/build/.variables | 5 +++-- scripts/build/cross | 10 ++++++++-- scripts/build/linux-cross | 19 ------------------- 5 files changed, 11 insertions(+), 31 deletions(-) delete mode 100755 scripts/build/linux-cross diff --git a/dockerfiles/Dockerfile.cross b/dockerfiles/Dockerfile.cross index 7e9aaacc24..f52c3e10dd 100644 --- a/dockerfiles/Dockerfile.cross +++ b/dockerfiles/Dockerfile.cross @@ -11,10 +11,6 @@ RUN apt-get update -qq && apt-get install -y -q \ parallel \ ; -RUN go get github.com/mitchellh/gox && \ - cp /go/bin/gox /usr/bin && \ - rm -rf /go/src/* /go/pkg/* /go/bin/* - COPY dockerfiles/osx-cross.sh /tmp/ RUN /tmp/osx-cross.sh ENV PATH /osxcross/target/bin:$PATH diff --git a/dockerfiles/Dockerfile.dev b/dockerfiles/Dockerfile.dev index a14ea25f29..f3e058e285 100644 --- a/dockerfiles/Dockerfile.dev +++ b/dockerfiles/Dockerfile.dev @@ -7,10 +7,6 @@ RUN go get github.com/LK4D4/vndr && \ cp /go/bin/vndr /usr/bin && \ rm -rf /go/src/* /go/pkg/* /go/bin/* -RUN go get github.com/mitchellh/gox && \ - cp /go/bin/gox /usr/bin && \ - rm -rf /go/src/* /go/pkg/* /go/bin/* - RUN go get github.com/jteeuwen/go-bindata/go-bindata && \ cp /go/bin/go-bindata /usr/bin && \ rm -rf /go/src/* /go/pkg/* /go/bin/* diff --git a/scripts/build/.variables b/scripts/build/.variables index 12ca95e7d1..eb87c38268 100755 --- a/scripts/build/.variables +++ b/scripts/build/.variables @@ -1,5 +1,4 @@ #!/usr/bin/env bash - set -eu VERSION=${VERSION:-"unknown-version"} @@ -14,5 +13,7 @@ export LDFLAGS="\ ${LDFLAGS:-} \ " -export TARGET="build/docker-$(go env GOHOSTOS)-$(go env GOHOSTARCH)" +GOOS="${GOOS:-$(go env GOHOSTOS)}" +GOARCH="${GOARCH:-$(go env GOHOSTARCH)}" +export TARGET="build/docker-$GOOS-$GOARCH" export SOURCE="github.com/docker/cli/cmd/docker" diff --git a/scripts/build/cross b/scripts/build/cross index 51b8024ecb..9e7bfb35b8 100755 --- a/scripts/build/cross +++ b/scripts/build/cross @@ -1,12 +1,18 @@ #!/usr/bin/env bash +# +# Build a binary for all supported platforms +# set -eu -o pipefail BUILDDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -echo "Building all binaries" +echo "Building binaries for all platforms" SHELL=/bin/bash parallel ::: \ - "$BUILDDIR/linux-cross" \ "$BUILDDIR/windows" \ "$BUILDDIR/osx" \ + "GOOS=linux GOARCH=amd64 $BUILDDIR/binary" \ + "GOOS=linux GOARCH=arm $BUILDDIR/binary" \ + "GOOS=linux GOARCH=ppc64le $BUILDDIR/binary" \ + "GOOS=linux GOARCH=s390x $BUILDDIR/binary" \ ; diff --git a/scripts/build/linux-cross b/scripts/build/linux-cross deleted file mode 100755 index 53aa0e1511..0000000000 --- a/scripts/build/linux-cross +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -# -# Build static linux binary for multiple architectures -# - -set -eu -o pipefail - -source ./scripts/build/.variables - -CROSS_OSARCH="linux/amd64 linux/arm linux/ppc64le" - -# Not yet supported by gox -# linux/s390x - -echo "Building all linux binaries" -gox -output build/docker-{{.OS}}-{{.Arch}} \ - -osarch "${CROSS_OSARCH}" \ - --ldflags "${LDFLAGS}" \ - "${SOURCE}"