From af25fd78e8edcf0d46acdd5f45d1379770753b30 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Fri, 30 Dec 2016 16:12:30 -0700 Subject: util/docker: Update makefile with command to kill docker images Kill running docker containers before trying to remove images or containers. Change-Id: Id2de90edbe5d0dc6ecb906be7101ad9744dbd11e Signed-off-by: Martin Roth Reviewed-on: https://review.coreboot.org/17999 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Patrick Georgi --- util/docker/Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'util/docker') diff --git a/util/docker/Makefile b/util/docker/Makefile index 45e23b0091..113e1ca866 100644 --- a/util/docker/Makefile +++ b/util/docker/Makefile @@ -39,10 +39,15 @@ coreboot-jenkins-node: test_docker upload-coreboot-jenkins-node: test_docker_login $(DOCKER) push coreboot/coreboot-jenkins-node:$(crossgcc_version) -clean_coreboot_containers: test_docker +docker-killall: test_docker + @if [ -n "$$($(DOCKER) ps | grep 'coreboot')" ]; then \ + $(DOCKER) kill $$($(DOCKER) ps | grep 'coreboot' | cut -f1 -d ' '); \ + fi + +clean_coreboot_containers: docker-killall $(DOCKER) rm $(docker ps -a | grep 'coreboot' | sed 's|\s.*$||') -clean_coreboot_images: test_docker +clean_coreboot_images: docker-killall $(DOCKER) rmi $(docker images | grep coreboot | sed 's|^\S\+\s\+\S\+\s\+||' | sed 's|\s.*$||') docker_build_coreboot: test_docker -- cgit v1.2.3