Skip to content

Commit

Permalink
Merge pull request docker#1927 from cpuguy83/backport_goarm
Browse files Browse the repository at this point in the history
[19.03] Backport docker#1857: Support GOARM and windows .exe in binary target
  • Loading branch information
thaJeztah committed Jun 6, 2019
2 parents 49236a4 + 5d246f4 commit a63faeb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docker.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 14 additions & 1 deletion scripts/build/.variables
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit a63faeb

Please sign in to comment.