mirror of https://github.com/docker/cli.git
allow version number to be set in builds
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
This commit is contained in:
parent
883d28cfce
commit
3dfe334a7a
|
@ -8,6 +8,7 @@ DEV_DOCKER_IMAGE_NAME = docker-cli-dev
|
||||||
LINTER_IMAGE_NAME = docker-cli-lint
|
LINTER_IMAGE_NAME = docker-cli-lint
|
||||||
CROSS_IMAGE_NAME = docker-cli-cross
|
CROSS_IMAGE_NAME = docker-cli-cross
|
||||||
MOUNTS = -v `pwd`:/go/src/github.com/docker/cli
|
MOUNTS = -v `pwd`:/go/src/github.com/docker/cli
|
||||||
|
VERSION = $(shell cat VERSION)
|
||||||
|
|
||||||
# build docker image (dockerfiles/Dockerfile.build)
|
# build docker image (dockerfiles/Dockerfile.build)
|
||||||
.PHONY: build_docker_image
|
.PHONY: build_docker_image
|
||||||
|
@ -26,7 +27,7 @@ build_cross_image:
|
||||||
|
|
||||||
# build executable using a container
|
# build executable using a container
|
||||||
binary: build_docker_image
|
binary: build_docker_image
|
||||||
docker run --rm $(MOUNTS) $(DEV_DOCKER_IMAGE_NAME) make binary
|
docker run --rm -e VERSION=$(VERSION) $(MOUNTS) $(DEV_DOCKER_IMAGE_NAME) make binary
|
||||||
|
|
||||||
build: binary
|
build: binary
|
||||||
|
|
||||||
|
@ -43,7 +44,7 @@ test: build_docker_image
|
||||||
# build the CLI for multiple architectures using a container
|
# build the CLI for multiple architectures using a container
|
||||||
.PHONY: cross
|
.PHONY: cross
|
||||||
cross: build_cross_image
|
cross: build_cross_image
|
||||||
docker run --rm $(MOUNTS) $(CROSS_IMAGE_NAME) make cross
|
docker run --rm -e VERSION=$(VERSION) $(MOUNTS) $(CROSS_IMAGE_NAME) make cross
|
||||||
|
|
||||||
.PHONY: watch
|
.PHONY: watch
|
||||||
watch: build_docker_image
|
watch: build_docker_image
|
||||||
|
|
|
@ -11,7 +11,7 @@ export CGO_ENABLED=1
|
||||||
export GOOS=darwin
|
export GOOS=darwin
|
||||||
export GOARCH=amd64
|
export GOARCH=amd64
|
||||||
export CC=o64-clang
|
export CC=o64-clang
|
||||||
export LDFLAGS='-linkmode external -s'
|
export LDFLAGS="$LDFLAGS -linkmode external -s"
|
||||||
export LDFLAGS_STATIC_DOCKER='-extld='${CC}
|
export LDFLAGS_STATIC_DOCKER='-extld='${CC}
|
||||||
|
|
||||||
# Override TARGET
|
# Override TARGET
|
||||||
|
|
Loading…
Reference in New Issue