kolla/tools/cleanup-images
Paul Bourke 731f0bb114 Add force flag to cleanup-images
TrivialFix

Change-Id: I83dfca7d0ad38411ac43ca89de439705a8e5aa12
2016-08-17 10:28:38 +00:00

17 lines
387 B
Bash
Executable File

#!/bin/bash
# Move to top level directory
REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')")
cd "$(dirname "$REAL_PATH")/.."
. tools/validate-docker-execute.sh
KOLLA_IMAGES=$(docker images -a --filter "label=kolla_version" --format "{{.ID}}")
if [[ -z "$KOLLA_IMAGES" ]]; then
echo "No images to cleanup, exit now."
exit 0
fi
docker rmi -f $@ $KOLLA_IMAGES