Makefile
100267de
 .PHONY: all binary build cross default docs docs-build docs-shell shell test test-unit test-integration test-integration-cli test-docker-py validate
26533eb2
 
82f33d86
 # env vars passed through directly to Docker's build scripts
 # to allow things like `make DOCKER_CLIENTONLY=1 binary` easily
 # `docs/sources/contributing/devenvironment.md ` and `project/PACKAGERS.md` have some limited documentation of some of these
 DOCKER_ENVS := \
 	-e BUILDFLAGS \
 	-e DOCKER_CLIENTONLY \
 	-e DOCKER_EXECDRIVER \
 	-e DOCKER_GRAPHDRIVER \
 	-e TESTDIRS \
 	-e TESTFLAGS \
 	-e TIMEOUT
 # note: we _cannot_ add "-e DOCKER_BUILDTAGS" here because even if it's unset in the shell, that would shadow the "ENV DOCKER_BUILDTAGS" set in our Dockerfile, which is very important for our official builds
 
987050a5
 # to allow `make BIND_DIR=. shell` or `make BIND_DIR= test`
c2653b0a
 # (default to no bind mount if DOCKER_HOST is set)
987050a5
 # note: BINDDIR is supported for backwards-compatibility here
 BIND_DIR := $(if $(BINDDIR),$(BINDDIR),$(if $(DOCKER_HOST),,bundles))
 DOCKER_MOUNT := $(if $(BIND_DIR),-v "$(CURDIR)/$(BIND_DIR):/go/src/github.com/docker/docker/$(BIND_DIR)")
82f33d86
 
 # to allow `make DOCSDIR=docs docs-shell` (to create a bind mount in docs)
 DOCS_MOUNT := $(if $(DOCSDIR),-v $(CURDIR)/$(DOCSDIR):/$(DOCSDIR))
 
b51fe178
 # to allow `make DOCSPORT=9000 docs`
 DOCSPORT := 8000
bd24eb07
 
b51fe178
 GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
 DOCKER_IMAGE := docker$(if $(GIT_BRANCH),:$(GIT_BRANCH))
 DOCKER_DOCS_IMAGE := docker-docs$(if $(GIT_BRANCH),:$(GIT_BRANCH))
bd24eb07
 
912b0f0f
 DOCKER_RUN_DOCKER := docker run --rm -it --privileged $(DOCKER_ENVS) $(DOCKER_MOUNT) "$(DOCKER_IMAGE)"
82f33d86
 
a6a748b9
 DOCKER_RUN_DOCS := docker run --rm -it $(DOCS_MOUNT) -e AWS_S3_BUCKET -e NOCACHE
82f33d86
 
8d4459ff
 # for some docs workarounds (see below in "docs-build" target)
 GITCOMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)
 
00030ced
 default: binary
 
 all: build
 	$(DOCKER_RUN_DOCKER) hack/make.sh
 
 binary: build
 	$(DOCKER_RUN_DOCKER) hack/make.sh binary
26533eb2
 
62a81370
 cross: build
4100e9b7
 	$(DOCKER_RUN_DOCKER) hack/make.sh binary cross
62a81370
 
eaa9c855
 docs: docs-build
e0af429a
 	$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" mkdocs serve
26533eb2
 
eaa9c855
 docs-shell: docs-build
e0af429a
 	$(DOCKER_RUN_DOCS) -p $(if $(DOCSPORT),$(DOCSPORT):)8000 "$(DOCKER_DOCS_IMAGE)" bash
936a03bf
 
 docs-release: docs-build
3e84b9e5
 	$(DOCKER_RUN_DOCS) -e OPTIONS -e BUILD_ROOT -e DISTRIBUTION_ID \
 		-v $(CURDIR)/docs/awsconfig:/docs/awsconfig \
 		"$(DOCKER_DOCS_IMAGE)" ./release.sh
eaa9c855
 
fbb9223b
 docs-test: docs-build
 	$(DOCKER_RUN_DOCS) "$(DOCKER_DOCS_IMAGE)" ./test.sh
 
00030ced
 test: build
5d6eca66
 	$(DOCKER_RUN_DOCKER) hack/make.sh binary cross test-unit test-integration test-integration-cli test-docker-py
a39f3c92
 
 test-unit: build
 	$(DOCKER_RUN_DOCKER) hack/make.sh test-unit
26533eb2
 
4326e541
 test-integration: build
 	$(DOCKER_RUN_DOCKER) hack/make.sh test-integration
 
6db32fde
 test-integration-cli: build
 	$(DOCKER_RUN_DOCKER) hack/make.sh binary test-integration-cli
 
100267de
 test-docker-py: build
 	$(DOCKER_RUN_DOCKER) hack/make.sh binary test-docker-py
 
7de1557b
 validate: build
d245a8a7
 	$(DOCKER_RUN_DOCKER) hack/make.sh validate-gofmt validate-dco validate-toml
7de1557b
 
00030ced
 shell: build
 	$(DOCKER_RUN_DOCKER) bash
 
 build: bundles
0b4aeb79
 	docker build -t "$(DOCKER_IMAGE)" .
56ab9cb0
 
eaa9c855
 docs-build:
8d4459ff
 	cp ./VERSION docs/VERSION
 	echo "$(GIT_BRANCH)" > docs/GIT_BRANCH
 #	echo "$(AWS_S3_BUCKET)" > docs/AWS_S3_BUCKET
 	echo "$(GITCOMMIT)" > docs/GITCOMMIT
6c492a2d
 	docker pull docs/base
8d4459ff
 	docker build -t "$(DOCKER_DOCS_IMAGE)" docs
eaa9c855
 
56ab9cb0
 bundles:
 	mkdir bundles