docker_helper: stop and remove container in container_remove

This commit is contained in:
Sameer Naik
2015-11-09 18:02:05 +05:30
parent 14dec07d4a
commit ad4cfbc71e

View File

@@ -55,15 +55,19 @@ container_stop() {
# Restart a running container (stops the container and then starts it)
# $1: name of the container
container_restart() {
container_stop $1
container_start $1
if docker ps | grep -q $CONTAINER_NAME-$1; then
docker stop $CONTAINER_NAME-$1
docker start $CONTAINER_NAME-$1
sleep $SLEEP_TIME
fi
}
# Remove a running/stopped container
# $1: name of the container
container_remove() {
if docker ps -a | grep -q $CONTAINER_NAME-$1; then
docker rm -fv $CONTAINER_NAME-$1
docker stop $CONTAINER_NAME-$1
docker rm -v $CONTAINER_NAME-$1
fi
}