@@ -76,26 +76,21 @@ $(linked_scripts):
7676 @ln -s scripts/$@ .sh ./$@
7777 @chmod a+x ./$@
7878
79- # Cleaning methods
80- stop_container = docker stop $1 &> /dev/null
81- remove_container = docker rm $1 &> /dev/null
82- remove_image = docker rmi $1 &> /dev/null
83-
84- list_containers = $(shell docker ps -qa --filter="ancestor=$1" &> /dev/null)
79+ # Cleaning
80+ remove_container = $(shell docker rm -f $1)
81+ remove_image = $(shell docker rmi $1)
82+ list_containers = $(shell docker ps -qa --filter="ancestor=$1")
8583for_each_container = $(foreach container,$(call list_containers,$1) ,\
86- $(info --> Stopping $(container ) ) \
87- $(call stop_container,$(container ) ) \
88- $(info --> Removing $(container ) ) \
8984 $(call remove_container,$(container ) ) \
9085 $(info --> Removed $(container ) ) \
9186 )
9287for_each_image = $(foreach image,$1,\
9388 $(info Checking $(image ) :$(VERSION ) ...) \
9489 $(if $(call image_check,$(image ) :$(VERSION ) ) ,\
9590 $(call for_each_container,$(image ) ) \
96- $(info Removing $(image ) :$(VERSION ) and latest ) \
91+ $(call remove_image, $(image ) :$(VERSION ) ) \
9792 $(call remove_image,$(image ) :latest) \
98- $(call remove_image, $(image ) :$(VERSION ) ) , \
93+ $(info Removed with $(image ) :$(VERSION ) and latest ) , \
9994 $(info Nothing to do for $(image ) :$(VERSION ) ) \
10095 ) \
10196 )
0 commit comments