21 lines
614 B
Bash
Executable File
21 lines
614 B
Bash
Executable File
#!/bin/bash
|
|
ENV_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
source $ENV_DIR/bin/messages
|
|
|
|
warnmsg "This script will remove all docker containers and images"
|
|
warnmsg "All your data will be lost, and you will have a \"clean\" dev-env again"
|
|
warnmsg "Do you want to continue? (y/n)"
|
|
read -p "Answer: " ANSWER
|
|
echo ""
|
|
|
|
if [[ "$ANSWER" == "y" || "$ANSWER" == "Y" ]]; then
|
|
infomsg "[dev-env]: Clearing docker"
|
|
docker rm -vf $(docker ps -aq)
|
|
docker rmi -f $(docker images -aq)
|
|
docker network prune -f
|
|
echo ""
|
|
|
|
docker ps
|
|
else
|
|
infomsg "[dev-env]: prune cancelled"
|
|
fi |