Build the docker cli for unreleased platforms
-#!/bin/sh
+#!/usr/bin/env bash
set -e
set -x
@@ -52,7 +52,12 @@ install_dockercli() {
echo "Install docker/cli version $DOCKERCLI_VERSION from $DOCKERCLI_CHANNEL"
arch=$(uname -m)
- echo "Docker CLI ARCH $arch"
+ # No official release of these platforms
+ if [[ "$arch" != "x86_64" ]] && [[ "$arch" != "s390x" ]]; then
+ build_dockercli
+ return
+ fi
+
url=https://download.docker.com/linux/static
curl -Ls $url/$DOCKERCLI_CHANNEL/$arch/docker-$DOCKERCLI_VERSION.tgz | \
tar -xz docker/docker
@@ -60,6 +65,16 @@ install_dockercli() {
rmdir docker
}
+build_dockercli() {
+ DOCKERCLI_VERSION=${DOCKERCLI_VERSION:-17.06.0-ce}
+ git clone https://github.com/docker/docker-ce "$GOPATH/tmp/docker-ce"
+ cd "$GOPATH/tmp/docker-ce"
+ git checkout -q "v$DOCKERCLI_VERSION"
+ mkdir -p "$GOPATH/src/github.com/docker"
+ mv components/cli "$GOPATH/src/github.com/docker/cli"
+ go build -o /usr/local/bin/docker github.com/docker/cli/cmd/docker
+}
+
install_gometalinter() {
echo "Installing gometalinter version $GOMETALINTER_COMMIT"
go get -d github.com/alecthomas/gometalinter
