github.com/Hnampk/fabric@v2.1.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  DOCKER_NS ?= hyperledger
    27  DOCKER_TAG=$(ARCH)-$(PROJECT_VERSION)
    28  
    29  BASE_DOCKER_LABEL=org.hyperledger.fabric
    30  
    31  #
    32  # What is a .dummy file?
    33  #
    34  # Make is designed to work with files.  It uses the presence (or lack thereof)
    35  # and timestamps of files when deciding if a given target needs to be rebuilt.
    36  # Docker containers throw a wrench into the works because the output of docker
    37  # builds do not translate into standard files that makefile rules can evaluate.
    38  # Therefore, we have to fake it.  We do this by constructioning our rules such
    39  # as
    40  #       my-docker-target/.dummy:
    41  #              docker build ...
    42  #              touch $@
    43  #
    44  # If the docker-build succeeds, the touch operation creates/updates the .dummy
    45  # file.  If it fails, the touch command never runs.  This means the .dummy
    46  # file follows relatively 1:1 with the underlying container.
    47  #
    48  # This isn't perfect, however.  For instance, someone could delete a docker
    49  # container using docker-rmi outside of the build, and make would be fooled
    50  # into thinking the dependency is statisfied when it really isn't.  This is
    51  # our closest approximation we can come up with.
    52  #
    53  # As an aside, also note that we incorporate the version number in the .dummy
    54  # file to differentiate different tags to fix FAB-1145
    55  #
    56  DUMMY = .dummy-$(DOCKER_TAG)