summaryrefslogtreecommitdiff
path: root/util/docker/Makefile
diff options
context:
space:
mode:
authorMartin Roth <gaumless@gmail.com>2016-12-30 16:12:30 -0700
committerMartin Roth <martinroth@google.com>2017-01-27 19:40:41 +0100
commitaf25fd78e8edcf0d46acdd5f45d1379770753b30 (patch)
tree966b2069d85fa35ddda99365053b3751f7e8cddd /util/docker/Makefile
parent27f3ce6337b293cfc7be0eb8592feb411cf2cc5f (diff)
downloadcoreboot-af25fd78e8edcf0d46acdd5f45d1379770753b30.tar.xz
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 <gaumless@gmail.com> Reviewed-on: https://review.coreboot.org/17999 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'util/docker/Makefile')
-rw-r--r--util/docker/Makefile9
1 files changed, 7 insertions, 2 deletions
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