github.com/tompao/docker@v1.9.1/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_REMAP_ROOT \
    13  	-e DOCKER_GRAPHDRIVER \
    14  	-e DOCKER_STORAGE_OPTS \
    15  	-e DOCKER_USERLANDPROXY \
    16  	-e TESTDIRS \
    17  	-e TESTFLAGS \
    18  	-e TIMEOUT
    19  # 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
    20  
    21  # to allow `make BIND_DIR=. shell` or `make BIND_DIR= test`
    22  # (default to no bind mount if DOCKER_HOST is set)
    23  # note: BINDDIR is supported for backwards-compatibility here
    24  BIND_DIR := $(if $(BINDDIR),$(BINDDIR),$(if $(DOCKER_HOST),,bundles))
    25  DOCKER_MOUNT := $(if $(BIND_DIR),-v "$(CURDIR)/$(BIND_DIR):/go/src/github.com/docker/docker/$(BIND_DIR)")
    26  
    27  
    28  GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
    29  DOCKER_IMAGE := docker-dev$(if $(GIT_BRANCH),:$(GIT_BRANCH))
    30  DOCKER_DOCS_IMAGE := docker-docs$(if $(GIT_BRANCH),:$(GIT_BRANCH))
    31  
    32  DOCKER_RUN_DOCKER := docker run --rm -it --privileged $(DOCKER_ENVS) $(DOCKER_MOUNT) "$(DOCKER_IMAGE)"
    33  
    34  DOCKER_RUN_DOCS := docker run --rm -it $(DOCS_MOUNT) -e AWS_S3_BUCKET -e NOCACHE
    35  
    36  # for some docs workarounds (see below in "docs-build" target)
    37  GITCOMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)
    38  
    39  default: binary
    40  
    41  all: build
    42  	$(DOCKER_RUN_DOCKER) hack/make.sh
    43  
    44  binary: build
    45  	$(DOCKER_RUN_DOCKER) hack/make.sh binary
    46  
    47  cross: build
    48  	$(DOCKER_RUN_DOCKER) hack/make.sh binary cross
    49  
    50  deb: build
    51  	$(DOCKER_RUN_DOCKER) hack/make.sh binary build-deb
    52  
    53  rpm: build
    54  	$(DOCKER_RUN_DOCKER) hack/make.sh binary build-rpm
    55  
    56  test: build
    57  	$(DOCKER_RUN_DOCKER) hack/make.sh binary cross test-unit test-integration-cli test-docker-py
    58  
    59  test-unit: build
    60  	$(DOCKER_RUN_DOCKER) hack/make.sh test-unit
    61  
    62  test-integration-cli: build
    63  	$(DOCKER_RUN_DOCKER) hack/make.sh binary test-integration-cli
    64  
    65  test-docker-py: build
    66  	$(DOCKER_RUN_DOCKER) hack/make.sh binary test-docker-py
    67  
    68  validate: build
    69  	$(DOCKER_RUN_DOCKER) hack/make.sh validate-dco validate-gofmt validate-pkg validate-lint validate-test validate-toml validate-vet
    70  
    71  shell: build
    72  	$(DOCKER_RUN_DOCKER) bash
    73  
    74  build: bundles
    75  	docker build -t "$(DOCKER_IMAGE)" .
    76  
    77  bundles:
    78  	mkdir bundles
    79  
    80  docs:
    81  	$(MAKE) -C docs docs