diff --git a/Makefile b/Makefile index 1c0c02e8a..0dfd8b6e4 100644 --- a/Makefile +++ b/Makefile @@ -109,6 +109,8 @@ TRIVYADAPTERVERSION=v0.31.2 # version of registry for pulling the source code REGISTRY_SRC_TAG=v2.8.3 +# source of upstream distribution code +DISTRIBUTION_SRC=https://github.com/distribution/distribution.git # dependency binaries REGISTRYURL=https://storage.googleapis.com/harbor-builds/bin/registry/release-${REGISTRYVERSION}/registry @@ -388,7 +390,7 @@ build: exit 1; \ fi make -f $(MAKEFILEPATH_PHOTON)/Makefile $(BUILDTARGET) -e DEVFLAG=$(DEVFLAG) -e GOBUILDIMAGE=$(GOBUILDIMAGE) \ - -e REGISTRYVERSION=$(REGISTRYVERSION) -e REGISTRY_SRC_TAG=$(REGISTRY_SRC_TAG) \ + -e REGISTRYVERSION=$(REGISTRYVERSION) -e REGISTRY_SRC_TAG=$(REGISTRY_SRC_TAG) -e DISTRIBUTION_SRC=$(DISTRIBUTION_SRC)\ -e TRIVYVERSION=$(TRIVYVERSION) -e TRIVYADAPTERVERSION=$(TRIVYADAPTERVERSION) \ -e VERSIONTAG=$(VERSIONTAG) \ -e BUILDBIN=$(BUILDBIN) \ diff --git a/make/photon/Makefile b/make/photon/Makefile index c6de67da3..0dc0678cc 100644 --- a/make/photon/Makefile +++ b/make/photon/Makefile @@ -178,7 +178,7 @@ _build_registry: rm -rf $(DOCKERFILEPATH_REG)/binary && mkdir -p $(DOCKERFILEPATH_REG)/binary && \ $(call _get_binary, $(REGISTRYURL), $(DOCKERFILEPATH_REG)/binary/registry); \ else \ - cd $(DOCKERFILEPATH_REG) && $(DOCKERFILEPATH_REG)/builder $(REGISTRY_SRC_TAG) && cd - ; \ + cd $(DOCKERFILEPATH_REG) && $(DOCKERFILEPATH_REG)/builder $(REGISTRY_SRC_TAG) $(DISTRIBUTION_SRC) && cd - ; \ fi @echo "building registry container for photon..." @chmod 655 $(DOCKERFILEPATH_REG)/binary/registry && $(DOCKERBUILD_WITH_PULL_PARA) --build-arg harbor_base_image_version=$(BASEIMAGETAG) --build-arg harbor_base_namespace=$(BASEIMAGENAMESPACE) -f $(DOCKERFILEPATH_REG)/$(DOCKERFILENAME_REG) -t $(DOCKERIMAGENAME_REG):$(VERSIONTAG) . diff --git a/make/photon/registry/builder b/make/photon/registry/builder index e076f8565..0c254cbf7 100755 --- a/make/photon/registry/builder +++ b/make/photon/registry/builder @@ -7,7 +7,13 @@ if [ -z $1 ]; then exit 1 fi +if [ -z $2 ]; then + error "Please set the 'distribution_src' variable" + exit 1 +fi + VERSION="$1" +DISTRIBUTION_SRC="$2" set -e @@ -20,7 +26,7 @@ cur=$PWD # the temp folder to store distribution source code... TEMP=`mktemp -d ${TMPDIR-/tmp}/distribution.XXXXXX` -git clone -b $VERSION https://github.com/distribution/distribution.git $TEMP +git clone -b $VERSION $DISTRIBUTION_SRC $TEMP # add patch redis cd $TEMP