2018-02-16 13:51:30 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
2019-09-12 16:22:56 -04:00
|
|
|
: ${DOCKERCLI_CHANNEL:=stable}
|
|
|
|
: ${DOCKERCLI_VERSION:=17.06.2-ce}
|
2018-02-16 13:51:30 -05:00
|
|
|
|
|
|
|
install_dockercli() {
|
|
|
|
echo "Install docker/cli version $DOCKERCLI_VERSION from $DOCKERCLI_CHANNEL"
|
|
|
|
|
|
|
|
arch=$(uname -m)
|
|
|
|
# No official release of these platforms
|
2019-01-13 15:38:00 -05:00
|
|
|
if [ "$arch" != "x86_64" ] && [ "$arch" != "s390x" ] && [ "$arch" != "armhf" ]; then
|
2018-02-16 13:51:30 -05:00
|
|
|
build_dockercli
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
url=https://download.docker.com/linux/static
|
2018-12-22 14:18:33 -05:00
|
|
|
curl -Ls "${url}/${DOCKERCLI_CHANNEL}/${arch}/docker-${DOCKERCLI_VERSION}.tgz" | tar -xz docker/docker
|
2019-01-13 15:38:00 -05:00
|
|
|
mkdir -p "${PREFIX}"
|
|
|
|
mv docker/docker "${PREFIX}/"
|
2018-02-16 13:51:30 -05:00
|
|
|
rmdir docker
|
|
|
|
}
|
|
|
|
|
|
|
|
build_dockercli() {
|
|
|
|
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"
|
2020-05-20 21:23:00 -04:00
|
|
|
go build ${GO_BUILDMODE} -o "${PREFIX}/docker" "github.com/docker/cli/cmd/docker"
|
2018-02-16 13:51:30 -05:00
|
|
|
}
|