From bfcfe676b4f3972a57a2286c298c71394a2d2150 Mon Sep 17 00:00:00 2001 From: Vasily Evseenko Date: Fri, 16 Aug 2024 12:12:44 +0300 Subject: [PATCH] Fix docker image cleanup --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d0b6d43..84c6d75 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ osd_docker: /opt/qemu/bin if ! ls /proc/sys/fs/binfmt_misc | grep -q qemu ; then sudo ./docker/qemu-binfmt-conf.sh --qemu-path /opt/qemu/bin --persistent yes; fi TAG="wfb-ng-osg:build-`date +%s`"; docker build -t $$TAG docker --build-arg SRC_IMAGE=$(DOCKER_SRC_IMAGE) && \ docker run -i --rm -v $(PWD):/build $$TAG bash -c "trap 'chown -R --reference=. .' EXIT; export VERSION=$(VERSION) COMMIT=$(COMMIT) SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) && cd /build && make clean && make osd mode=$(mode)" - docker image ls -q "wfb-ng-osd:build-*" | tail -n+5 | while read i ; do docker rmi $$i; done + docker image ls -q "wfb-ng-osd:build-*" | uniq | tail -n+6 | while read i ; do docker rmi -f $$i; done clean: rm -f osd *.o *~