Makefile 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # Copyright (c) 2020 Docker Inc.
  2. # Permission is hereby granted, free of charge, to any person
  3. # obtaining a copy of this software and associated documentation
  4. # files (the "Software"), to deal in the Software without
  5. # restriction, including without limitation the rights to use, copy,
  6. # modify, merge, publish, distribute, sublicense, and/or sell copies
  7. # of the Software, and to permit persons to whom the Software is
  8. # furnished to do so, subject to the following conditions:
  9. # The above copyright notice and this permission notice shall be
  10. # included in all copies or substantial portions of the Software.
  11. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  12. # EXPRESS OR IMPLIED,
  13. # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  15. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  16. # HOLDERS BE LIABLE FOR ANY CLAIM,
  17. # DAMAGES OR OTHER LIABILITY,
  18. # WHETHER IN AN ACTION OF CONTRACT,
  19. # TORT OR OTHERWISE,
  20. # ARISING FROM, OUT OF OR IN CONNECTION WITH
  21. # THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. export DOCKER_BUILDKIT=1
  23. UNAME_S := $(shell uname -s)
  24. ifeq ($(UNAME_S),Linux)
  25. CLASSIC_DOCKER=/usr/bin/docker
  26. endif
  27. ifeq ($(UNAME_S),Darwin)
  28. CLASSIC_DOCKER=/Applications/Docker.app/Contents/Resources/bin/docker
  29. endif
  30. all: cli
  31. protos: ## Generate go code from .proto files
  32. @docker build . --target protos \
  33. --output ./protos
  34. cli: ## Compile the cli
  35. @docker build . --target cli \
  36. --platform local \
  37. --output ./bin
  38. e2e-local: ## Run End to end local tests
  39. go test -v ./tests/e2e ./tests/skip-win-ci-e2e ./moby/e2e
  40. e2e-win-ci: ## Run End to end local tests on windows CI, no docker for linux containers available ATM
  41. go test -v ./tests/e2e
  42. e2e-aci: ## Run End to end ACI tests (requires azure login)
  43. go test -v ./tests/aci-e2e
  44. cross: ## Compile the CLI for linux, darwin and windows
  45. @docker build . --target cross \
  46. --output ./bin \
  47. test: ## Run unit tests
  48. @docker build . --target test
  49. cache-clear: ## Clear the builder cache
  50. @docker builder prune --force --filter type=exec.cachemount --filter=unused-for=24h
  51. lint: ## run linter(s)
  52. @docker build . --target lint
  53. serve: cli ## start server
  54. @./bin/docker serve --address unix:///tmp/backend.sock
  55. classic-link: ## create docker-classic symlink if does not already exist
  56. ln -s $(CLASSIC_DOCKER) /usr/local/bin/docker-classic
  57. help: ## Show help
  58. @echo Please specify a build target. The choices are:
  59. @grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
  60. FORCE:
  61. .PHONY: all protos cli e2e-local cross test cache-clear lint serve classic-link help