mirror of https://github.com/docker/cli.git
Merge pull request #1857 from cpuguy83/allow_better_cross_support
Support GOARM and windows .exe in binary target
This commit is contained in:
commit
6402c0a5c9
|
@ -21,7 +21,7 @@ ifeq ($(DOCKER_CLI_GO_BUILD_CACHE),y)
|
|||
DOCKER_CLI_MOUNTS += -v "$(CACHE_VOLUME_NAME):/root/.cache/go-build"
|
||||
endif
|
||||
VERSION = $(shell cat VERSION)
|
||||
ENVVARS = -e VERSION=$(VERSION) -e GITCOMMIT -e PLATFORM -e TESTFLAGS -e TESTDIRS
|
||||
ENVVARS = -e VERSION=$(VERSION) -e GITCOMMIT -e PLATFORM -e TESTFLAGS -e TESTDIRS -e GOOS -e GOARCH -e GOARM
|
||||
|
||||
# build docker image (dockerfiles/Dockerfile.build)
|
||||
.PHONY: build_docker_image
|
||||
|
|
|
@ -22,5 +22,18 @@ export LDFLAGS="\
|
|||
|
||||
GOOS="${GOOS:-$(go env GOHOSTOS)}"
|
||||
GOARCH="${GOARCH:-$(go env GOHOSTARCH)}"
|
||||
export TARGET="build/docker-$GOOS-$GOARCH"
|
||||
if [ "${GOARCH}" = "arm" ]; then
|
||||
GOARM="${GOARM:-$(go env GOHOSTARM)}"
|
||||
fi
|
||||
|
||||
TARGET="build/docker-$GOOS-$GOARCH"
|
||||
if [ "${GOARCH}" = "arm" ] && [ -n "${GOARM}" ]; then
|
||||
TARGET="${TARGET}-v${GOARM}"
|
||||
fi
|
||||
|
||||
if [ "${GOOS}" = "windows" ]; then
|
||||
TARGET="${TARGET}.exe"
|
||||
fi
|
||||
export TARGET
|
||||
|
||||
export SOURCE="github.com/docker/cli/cmd/docker"
|
||||
|
|
Loading…
Reference in New Issue