Skip to content

Commit a63faeb

Browse files
authored
Merge pull request docker#1927 from cpuguy83/backport_goarm
[19.03] Backport docker#1857: Support GOARM and windows .exe in binary target
2 parents 49236a4 + 5d246f4 commit a63faeb

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

docker.Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ifeq ($(DOCKER_CLI_GO_BUILD_CACHE),y)
2121
DOCKER_CLI_MOUNTS += -v "$(CACHE_VOLUME_NAME):/root/.cache/go-build"
2222
endif
2323
VERSION = $(shell cat VERSION)
24-
ENVVARS = -e VERSION=$(VERSION) -e GITCOMMIT -e PLATFORM -e TESTFLAGS -e TESTDIRS
24+
ENVVARS = -e VERSION=$(VERSION) -e GITCOMMIT -e PLATFORM -e TESTFLAGS -e TESTDIRS -e GOOS -e GOARCH -e GOARM
2525

2626
# build docker image (dockerfiles/Dockerfile.build)
2727
.PHONY: build_docker_image

scripts/build/.variables

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,18 @@ export LDFLAGS="\
2222

2323
GOOS="${GOOS:-$(go env GOHOSTOS)}"
2424
GOARCH="${GOARCH:-$(go env GOHOSTARCH)}"
25-
export TARGET="build/docker-$GOOS-$GOARCH"
25+
if [ "${GOARCH}" = "arm" ]; then
26+
GOARM="${GOARM:-$(go env GOHOSTARM)}"
27+
fi
28+
29+
TARGET="build/docker-$GOOS-$GOARCH"
30+
if [ "${GOARCH}" = "arm" ] && [ -n "${GOARM}" ]; then
31+
TARGET="${TARGET}-v${GOARM}"
32+
fi
33+
34+
if [ "${GOOS}" = "windows" ]; then
35+
TARGET="${TARGET}.exe"
36+
fi
37+
export TARGET
38+
2639
export SOURCE="github.com/docker/cli/cmd/docker"

0 commit comments

Comments
 (0)