Created
January 26, 2021 00:04
-
-
Save InfamousStarFox/02bca87993da8966e6ac1cbbc955c9dc to your computer and use it in GitHub Desktop.
Stops, deletes, rebuilds, and starts docker containers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stops, deletes, rebuilds, and starts docker containers | |
# Run in bash with ./docker-rebuild.sh | |
echo "STOP CONTAINERS"; | |
docker-compose down | |
docker ps -aq | xargs --no-run-if-empty docker stop | |
echo "REMOVE CONTAINERS"; | |
docker ps -aq | xargs --no-run-if-empty docker rm -f | |
echo "REMOVE VOLUMES"; | |
docker volume ls -q | xargs --no-run-if-empty docker volume rm | |
echo "REMOVE IMAGES"; | |
docker images -aq | xargs --no-run-if-empty docker rmi | |
echo "START CONTAINERS"; | |
docker-compose up -d | |
echo "DONE"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment