kolla/tools/cleanup-containers
Kai Qiang Wu(Kennan) da68e2eccc Improve scripts with some check before kick rm command
Closes-Bug: #1490387
Change-Id: I4a9476085b9c5b2cae3801e5b1954e85068f4e03
2015-08-31 05:13:59 +00:00

8 lines
159 B
Bash
Executable File

#!/bin/bash
CONTAINERS=`docker ps -a -q`
if [[ -z "$CONTAINERS" ]]; then
echo "No containers to cleanup, exit now."
exit 0
fi
docker rm $@ $CONTAINERS