Makefile
f7e417ea
 .PHONY: all binary build cross default docs docs-build docs-shell shell test test-unit 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 \
a121ac85
 	-e DOCKER_DEBUG \
82f33d86
 	-e DOCKER_EXECDRIVER \
ca6722f1
 	-e DOCKER_EXPERIMENTAL \
ea3afdad
 	-e DOCKER_REMAP_ROOT \
82f33d86
 	-e DOCKER_GRAPHDRIVER \
30f3bd64
 	-e DOCKER_STORAGE_OPTS \
d18919e3
 	-e DOCKER_USERLANDPROXY \
82f33d86
 	-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
 
bd24eb07
 
b51fe178
 GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
a4af8ad8
 DOCKER_IMAGE := docker-dev$(if $(GIT_BRANCH),:$(GIT_BRANCH))
b51fe178
 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
 
21a07a63
 deb: build
 	$(DOCKER_RUN_DOCKER) hack/make.sh binary build-deb
 
 rpm: build
 	$(DOCKER_RUN_DOCKER) hack/make.sh binary build-rpm
fbb9223b
 
00030ced
 test: build
f7e417ea
 	$(DOCKER_RUN_DOCKER) hack/make.sh binary cross test-unit test-integration-cli test-docker-py
a39f3c92
 
 test-unit: build
 	$(DOCKER_RUN_DOCKER) hack/make.sh test-unit
26533eb2
 
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
6cce8d18
 	$(DOCKER_RUN_DOCKER) hack/make.sh validate-dco validate-gofmt validate-pkg validate-lint validate-test validate-toml validate-vet
7de1557b
 
00030ced
 shell: build
 	$(DOCKER_RUN_DOCKER) bash
 
 build: bundles
0b4aeb79
 	docker build -t "$(DOCKER_IMAGE)" .
56ab9cb0
 
 bundles:
 	mkdir bundles
2bc0d2bf
 
 docs:
 	$(MAKE) -C docs docs