Tidy Makefiles

* Make BINARY mutability explicit
* Default docker build output type is local so use this

Signed-off-by: Christopher Crone <christopher.crone@docker.com>
This commit is contained in:
Christopher Crone 2020-06-02 11:53:13 +02:00
parent 9920fe2284
commit 654f9ebbaf
2 changed files with 13 additions and 16 deletions

View File

@ -29,12 +29,12 @@ all: cli
protos: ## Generate go code from .proto files protos: ## Generate go code from .proto files
@docker build . --target protos \ @docker build . --target protos \
--output type=local,dest=./protos --output ./protos
cli: ## Compile the cli cli: ## Compile the cli
@docker build . --target cli \ @docker build . --target cli \
--platform local \ --platform local \
--output type=local,dest=./bin --output ./bin
e2e-local: ## Run End to end local tests e2e-local: ## Run End to end local tests
go test -v ./tests/e2e ./moby/e2e go test -v ./tests/e2e ./moby/e2e
@ -43,20 +43,17 @@ e2e-aci: ## Run End to end ACI tests (requires azure login)
go test -v ./tests/aci-e2e go test -v ./tests/aci-e2e
cross: ## Compile the CLI for linux, darwin and windows cross: ## Compile the CLI for linux, darwin and windows
@docker build . \ @docker build . --target cross \
--output type=local,dest=./bin \ --output ./bin \
--target cross
test: ## Run unit tests test: ## Run unit tests
@docker build . \ @docker build . --target test
--target test
cache-clear: ## Clear the builder cache cache-clear: ## Clear the builder cache
@docker builder prune --force --filter type=exec.cachemount --filter=unused-for=24h @docker builder prune --force --filter type=exec.cachemount --filter=unused-for=24h
lint: ## run linter(s) lint: ## run linter(s)
@docker build . \ @docker build . --target lint
--target lint
classic-link: ## create docker-classic symlink if does not already exist classic-link: ## create docker-classic symlink if does not already exist
ln -s /Applications/Docker.app/Contents/Resources/bin/docker /usr/local/bin/docker-classic ln -s /Applications/Docker.app/Contents/Resources/bin/docker /usr/local/bin/docker-classic

View File

@ -37,7 +37,7 @@ STATIC_FLAGS=CGO_ENABLED=0
LDFLAGS:="-s -w" LDFLAGS:="-s -w"
GO_BUILD=$(STATIC_FLAGS) go build -trimpath -ldflags=$(LDFLAGS) GO_BUILD=$(STATIC_FLAGS) go build -trimpath -ldflags=$(LDFLAGS)
BINARY=bin/docker BINARY?=bin/docker
BINARY_WITH_EXTENSION=$(BINARY)$(EXTENSION) BINARY_WITH_EXTENSION=$(BINARY)$(EXTENSION)
all: cli all: cli