[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] automation: Add a clean rule for containers



commit 4755d10e9c57808c7e7128e9d9c4615d0eba5cda
Author:     Bertrand Marquis <bertrand.marquis@xxxxxxx>
AuthorDate: Thu Dec 1 14:25:31 2022 +0000
Commit:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
CommitDate: Fri Dec 9 14:55:33 2022 -0800

    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>
    Acked-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 automation/build/Makefile | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/automation/build/Makefile b/automation/build/Makefile
index c4aaa747ff..f1d56ce532 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))))
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.