From 164acad24f3006e07981f1580281d4a891407df3 Mon Sep 17 00:00:00 2001 From: He Weiwei Date: Thu, 17 Dec 2020 16:18:12 +0800 Subject: [PATCH] build: add cleanbaseimage target in Makefile (#13777) Add cleanbaseimage target in Makefile, and append it to the dependencies of the cleanall target. Closes #13602 Signed-off-by: He Weiwei --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8a22d73a2..f6b92ea3d 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,8 @@ # clean: remove binary, Harbor images, specific version docker-compose \ # file, specific version tag and online/offline install package # cleanbinary: remove core and jobservice binary +# cleanbaseimage: +# remove the base images of Harbor images # cleanimage: remove Harbor images # cleandockercomposefile: # remove specific version docker-compose @@ -566,6 +568,11 @@ cleanbinary: if [ -f $(MIGRATEPATCHBINARYPATH)/$(MIGRATEPATCHBINARYNAME) ] ; then rm $(MIGRATEPATCHBINARYPATH)/$(MIGRATEPATCHBINARYNAME) ; fi rm -rf make/photon/*/binary/ +cleanbaseimage: + @echo "cleaning base image for photon..." + @for name in chartserver trivy-adapter core db jobservice log nginx notary-server notary-signer portal prepare redis registry registryctl; do \ + $(DOCKERRMIMAGE) -f $(BASEIMAGENAMESPACE)/harbor-$$name-base:$(BASEIMAGETAG) ; \ + done cleanimage: @echo "cleaning image for photon..." @@ -598,12 +605,13 @@ cleanconfig: rm -f $(BUILDPATH)/src/portal/proxy.config.json .PHONY: cleanall -cleanall: cleanbinary cleanimage cleandockercomposefile cleanconfig cleanpackage +cleanall: cleanbinary cleanimage cleanbaseimage cleandockercomposefile cleanconfig cleanpackage clean: @echo " make cleanall: remove binary, Harbor images, specific version docker-compose" @echo " file, specific version tag, online and offline install package" @echo " make cleanbinary: remove core and jobservice binary" + @echo " make cleanbaseimage: remove base image of Harbor images" @echo " make cleanimage: remove Harbor images" @echo " make cleandockercomposefile: remove specific version docker-compose" @echo " make cleanpackage: remove online and offline install package"