2017-04-25 12:57:06 -04:00
|
|
|
#
|
|
|
|
# github.com/docker/cli
|
|
|
|
#
|
|
|
|
# Makefile for developing using Docker
|
|
|
|
#
|
|
|
|
|
|
|
|
+.PHONY: build_docker_image build clean cross dev
|
|
|
|
|
|
|
|
DEV_DOCKER_IMAGE_NAME = docker_cli_dev
|
|
|
|
|
|
|
|
# build docker image (dockerfiles/Dockerfile.build)
|
|
|
|
build_docker_image:
|
2017-04-27 17:55:05 -04:00
|
|
|
@docker build -q -t $(DEV_DOCKER_IMAGE_NAME) -f ./dockerfiles/Dockerfile.build .
|
2017-04-25 12:57:06 -04:00
|
|
|
|
|
|
|
# build executable using a container
|
|
|
|
build: build_docker_image
|
|
|
|
@echo "WARNING: this will drop a Linux executable on your host (not a macOS of Windows one)"
|
|
|
|
@docker run --rm -v `pwd`:/go/src/github.com/docker/cli $(DEV_DOCKER_IMAGE_NAME) make build
|
|
|
|
|
|
|
|
# clean build artifacts using a container
|
|
|
|
clean: build_docker_image
|
|
|
|
@docker run --rm -v `pwd`:/go/src/github.com/docker/cli $(DEV_DOCKER_IMAGE_NAME) make clean
|
|
|
|
|
2017-04-27 18:57:35 -04:00
|
|
|
# run go test
|
|
|
|
test: build_docker_image
|
|
|
|
@docker run --rm -v `pwd`:/go/src/github.com/docker/cli $(DEV_DOCKER_IMAGE_NAME) make test
|
|
|
|
|
2017-04-25 12:57:06 -04:00
|
|
|
# build the CLI for multiple architectures using a container
|
|
|
|
cross: build_docker_image
|
|
|
|
@docker run --rm -v `pwd`:/go/src/github.com/docker/cli $(DEV_DOCKER_IMAGE_NAME) make cross
|
|
|
|
|
|
|
|
# start container in interactive mode for in-container development
|
|
|
|
dev: build_docker_image
|
|
|
|
@docker run -ti -v `pwd`:/go/src/github.com/docker/cli $(DEV_DOCKER_IMAGE_NAME) ash
|