Improve scripts with some check before kick rm command
Closes-Bug: #1490387 Change-Id: I4a9476085b9c5b2cae3801e5b1954e85068f4e03
This commit is contained in:
parent
5f621a4fe9
commit
da68e2eccc
@ -1,3 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker rm $@ $(docker ps -a -q)
|
||||
CONTAINERS=`docker ps -a -q`
|
||||
if [[ -z "$CONTAINERS" ]]; then
|
||||
echo "No containers to cleanup, exit now."
|
||||
exit 0
|
||||
fi
|
||||
docker rm $@ $CONTAINERS
|
||||
|
@ -6,4 +6,9 @@ cd "$(dirname "$REAL_PATH")/.."
|
||||
|
||||
. tools/validate-docker-execute
|
||||
|
||||
docker rmi $@ $(docker images -a -q)
|
||||
IMAGES=`docker images -a -q`
|
||||
if [[ -z "$IMAGES" ]]; then
|
||||
echo "No images to cleanup, exit now."
|
||||
exit 0
|
||||
fi
|
||||
docker rmi $@ $IMAGES
|
||||
|
Loading…
Reference in New Issue
Block a user