github.com/gunjan5/docker@v1.8.2/Makefile (about)

     1  .PHONY: all binary build cross default docs docs-build docs-shell shell test test-unit test-integration-cli test-docker-py validate
     2  
     3  # env vars passed through directly to Docker's build scripts
     4  # to allow things like `make DOCKER_CLIENTONLY=1 binary` easily
     5  # `docs/sources/contributing/devenvironment.md ` and `project/PACKAGERS.md` have some limited documentation of some of these
     6  DOCKER_ENVS := \
     7  	-e BUILDFLAGS \
     8  	-e DOCKER_CLIENTONLY \
     9  	-e DOCKER_DEBUG \
    10  	-e DOCKER_EXECDRIVER \
    11  	-e DOCKER_EXPERIMENTAL \
    12  	-e DOCKER_GRAPHDRIVER \
    13  	-e DOCKER_STORAGE_OPTS \
    14  	-e DOCKER_USERLANDPROXY \
    15  	-e TESTDIRS \
    16  	-e TESTFLAGS \
    17  	-e TIMEOUT
    18  # 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
    19  
    20  # to allow `make BIND_DIR=. shell` or `make BIND_DIR= test`
    21  # (default to no bind mount if DOCKER_HOST is set)
    22  # note: BINDDIR is supported for backwards-compatibility here
    23  BIND_DIR := $(if $(BINDDIR),$(BINDDIR),$(if $(DOCKER_HOST),,bundles))
    24  DOCKER_MOUNT := $(if $(BIND_DIR),-v "$(CURDIR)/$(BIND_DIR):/go/src/github.com/docker/docker/$(BIND_DIR)")
    25  
    26  
    27  GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
    28  DOCKER_IMAGE := docker-dev$(if $(GIT_BRANCH),:$(GIT_BRANCH))
    29  DOCKER_DOCS_IMAGE := docker-docs$(if $(GIT_BRANCH),:$(GIT_BRANCH))
    30  
    31  DOCKER_RUN_DOCKER := docker run --rm -it --privileged $(DOCKER_ENVS) $(DOCKER_MOUNT) "$(DOCKER_IMAGE)"
    32  
    33  DOCKER_RUN_DOCS := docker run --rm -it $(DOCS_MOUNT) -e AWS_S3_BUCKET -e NOCACHE
    34  
    35  # for some docs workarounds (see below in "docs-build" target)
    36  GITCOMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)
    37  
    38  default: binary
    39  
    40  all: build
    41  	$(DOCKER_RUN_DOCKER) hack/make.sh
    42  
    43  binary: build
    44  	$(DOCKER_RUN_DOCKER) hack/make.sh binary
    45  
    46  cross: build
    47  	$(DOCKER_RUN_DOCKER) hack/make.sh binary cross
    48  
    49  deb: build
    50  	$(DOCKER_RUN_DOCKER) hack/make.sh binary build-deb
    51  
    52  rpm: build
    53  	$(DOCKER_RUN_DOCKER) hack/make.sh binary build-rpm
    54  
    55  test: build
    56  	$(DOCKER_RUN_DOCKER) hack/make.sh binary cross test-unit test-integration-cli test-docker-py
    57  
    58  test-unit: build
    59  	$(DOCKER_RUN_DOCKER) hack/make.sh test-unit
    60  
    61  test-integration-cli: build
    62  	$(DOCKER_RUN_DOCKER) hack/make.sh binary test-integration-cli
    63  
    64  test-docker-py: build
    65  	$(DOCKER_RUN_DOCKER) hack/make.sh binary test-docker-py
    66  
    67  validate: build
    68  	$(DOCKER_RUN_DOCKER) hack/make.sh validate-dco validate-gofmt validate-pkg validate-lint validate-test validate-toml validate-vet
    69  
    70  shell: build
    71  	$(DOCKER_RUN_DOCKER) bash
    72  
    73  build: bundles
    74  	docker build -t "$(DOCKER_IMAGE)" .
    75  
    76  bundles:
    77  	mkdir bundles
    78  
    79  docs:
    80  	$(MAKE) -C docs docs