Sha256: 1b5fc323edc9226fc2e8edc8cb18db5a4f6c7daabf00fa564b6239198cd40ac5

Contents?: true

Size: 596 Bytes

Versions: 18

Compression:

Stored size: 596 Bytes

Contents

EXITED=$(docker ps -q -f status=exited)
DANGLING=$(docker images -q -f "dangling=true")
DANGLING_VOLUME=$(docker volume ls -qf "dangling=true")

if [ "$1" == "--dry-run" ]; then
  echo "==> Would stop containers:"
  echo $EXITED
  echo "==> And images:"
  echo $DANGLING
else
  if [ -n "$EXITED" ]; then
    docker rm $EXITED
  else
    echo "No containers to remove."
  fi
  if [ -n "$DANGLING" ]; then
    docker rmi $DANGLING
  else
    echo "No images to remove."
  fi
  if [ -n "$DANGLING_VOLUME" ]; then
    docker volume rm $DANGLING_VOLUME
  else
    echo "No volumes to remove."
  fi
fi

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
redlock-2.0.6 clean_docker.sh
redlock-2.0.5 clean_docker.sh
redlock-2.0.4 clean_docker.sh
redlock-2.0.3 clean_docker.sh
redlock-2.0.2 clean_docker.sh
redlock-2.0.1 clean_docker.sh
redlock-2.0.0 clean_docker.sh
redlock-1.3.2 clean_docker.sh
redlock-1.3.1 clean_docker.sh
redlock-1.3.0 clean_docker.sh
redlock-1.2.2 clean_docker.sh
redlock-1.2.1 clean_docker.sh
redlock-1.2.0 clean_docker.sh
redlock-1.1.0 clean_docker.sh
redlock-1.0.1 clean_docker.sh
redlock-1.0.0 clean_docker.sh
redlock-0.2.2 clean_docker.sh
redlock-0.2.1 clean_docker.sh