define targets as “phony”, add comments, and mount docker.sock in dev target

Signed-off-by: Gaetan de Villele <gdevillele@gmail.com>
This commit is contained in:
Gaetan de Villele 2017-05-03 11:14:06 -07:00
parent 0a613971b9
commit 7f7e842702
2 changed files with 5 additions and 3 deletions

View File

@ -2,7 +2,7 @@
# github.com/docker/cli
#
.PHONY: build clean cross test lint
.PHONY: build clean test lint cross
# build the CLI
build: clean
@ -17,6 +17,7 @@ clean:
test:
@go test -tags daemon -v $(shell go list ./... | grep -v /vendor/)
# run linters
lint:
@gometalinter --config gometalinter.json ./...

View File

@ -4,7 +4,7 @@
# Makefile for developing using Docker
#
+.PHONY: build_docker_image build clean cross dev
+.PHONY: build_docker_image build_linter_image build clean test cross dev lint
DEV_DOCKER_IMAGE_NAME = docker-cli-dev
LINTER_IMAGE_NAME = docker-cli-lint
@ -37,7 +37,8 @@ cross: build_docker_image
# start container in interactive mode for in-container development
dev: build_docker_image
@docker run -ti $(MOUNTS) $(DEV_DOCKER_IMAGE_NAME) ash
@docker run -ti $(MOUNTS) -v /var/run/docker.sock:/var/run/docker.sock $(DEV_DOCKER_IMAGE_NAME) ash
# run linters in a container
lint: build_linter_image
@docker run -ti $(MOUNTS) $(LINTER_IMAGE_NAME)