[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v6 2/3] automation: Add a clean rule for containers
Add make clean support to remove the containers from the local docker registry. make clean-<image_name> must be called to remove an image: make clean-yocto/kirkstone-qemuarm: remove yocto kirkstone for qemuarm image Signed-off-by: Bertrand Marquis <bertrand.marquis@xxxxxxx> --- Changes in v6: - Rework clean rule to prevent calling docker during make parsing Changes in v5: - remove cleaning of all images using make clean Changes in v4: - also generate clean rule for CONTAINERS_EXTRA Changes in v3: - none Changes in v2: - none Changes in v1: - patch added --- automation/build/Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/automation/build/Makefile b/automation/build/Makefile index c4aaa747ffdf..f1d56ce532a1 100644 --- a/automation/build/Makefile +++ b/automation/build/Makefile @@ -28,3 +28,13 @@ all: $(CONTAINERS) clean: rm -f yocto/*.dockerfile +define CLEAN_RULE +.PHONY: clean-$(1) +clean-$(1): + if [ -n "$$$$(docker image ls -q $(REGISTRY)/$(subst /,:,$(1)))" ]; then \ + docker image rm $(REGISTRY)/$(subst /,:,$(1)); \ + fi + +endef + +$(eval $(foreach img,$(CONTAINERS) $(CONTAINERS_EXTRA),$(call CLEAN_RULE,$(img)))) -- 2.25.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |