github.com/kaituanwang/hyperledger@v2.0.1+incompatible/docker-env.mk (about) 1 # Copyright London Stock Exchange Group All Rights Reserved. 2 # 3 # SPDX-License-Identifier: Apache-2.0 4 5 ifneq ($(http_proxy),) 6 DOCKER_BUILD_FLAGS+=--build-arg 'http_proxy=$(http_proxy)' 7 endif 8 ifneq ($(https_proxy),) 9 DOCKER_BUILD_FLAGS+=--build-arg 'https_proxy=$(https_proxy)' 10 endif 11 ifneq ($(HTTP_PROXY),) 12 DOCKER_BUILD_FLAGS+=--build-arg 'HTTP_PROXY=$(HTTP_PROXY)' 13 endif 14 ifneq ($(HTTPS_PROXY),) 15 DOCKER_BUILD_FLAGS+=--build-arg 'HTTPS_PROXY=$(HTTPS_PROXY)' 16 endif 17 ifneq ($(no_proxy),) 18 DOCKER_BUILD_FLAGS+=--build-arg 'no_proxy=$(no_proxy)' 19 endif 20 ifneq ($(NO_PROXY),) 21 DOCKER_BUILD_FLAGS+=--build-arg 'NO_PROXY=$(NO_PROXY)' 22 endif 23 24 DBUILD = docker build --force-rm $(DOCKER_BUILD_FLAGS) 25 26 BASE_DOCKER_NS ?= hyperledger 27 BASE_DOCKER_TAG=$(ARCH)-$(BASEIMAGE_RELEASE) 28 29 DOCKER_NS ?= hyperledger 30 DOCKER_TAG=$(ARCH)-$(PROJECT_VERSION) 31 32 BASE_DOCKER_LABEL=org.hyperledger.fabric 33 34 # 35 # What is a .dummy file? 36 # 37 # Make is designed to work with files. It uses the presence (or lack thereof) 38 # and timestamps of files when deciding if a given target needs to be rebuilt. 39 # Docker containers throw a wrench into the works because the output of docker 40 # builds do not translate into standard files that makefile rules can evaluate. 41 # Therefore, we have to fake it. We do this by constructioning our rules such 42 # as 43 # my-docker-target/.dummy: 44 # docker build ... 45 # touch $@ 46 # 47 # If the docker-build succeeds, the touch operation creates/updates the .dummy 48 # file. If it fails, the touch command never runs. This means the .dummy 49 # file follows relatively 1:1 with the underlying container. 50 # 51 # This isn't perfect, however. For instance, someone could delete a docker 52 # container using docker-rmi outside of the build, and make would be fooled 53 # into thinking the dependency is statisfied when it really isn't. This is 54 # our closest approximation we can come up with. 55 # 56 # As an aside, also note that we incorporate the version number in the .dummy 57 # file to differentiate different tags to fix FAB-1145 58 # 59 DUMMY = .dummy-$(DOCKER_TAG)