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>
This commit is contained in:
Martin Roth 2016-12-30 16:12:30 -07:00 committed by Martin Roth
parent 27f3ce6337
commit af25fd78e8
1 changed files with 7 additions and 2 deletions

View File

@ -39,10 +39,15 @@ coreboot-jenkins-node: test_docker
upload-coreboot-jenkins-node: test_docker_login upload-coreboot-jenkins-node: test_docker_login
$(DOCKER) push coreboot/coreboot-jenkins-node:$(crossgcc_version) $(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.*$||') $(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) rmi $(docker images | grep coreboot | sed 's|^\S\+\s\+\S\+\s\+||' | sed 's|\s.*$||')
docker_build_coreboot: test_docker docker_build_coreboot: test_docker