Last active
September 12, 2020 18:48
-
-
Save ThatLurker/e61ea558a70e30ee5de934754e8931bd to your computer and use it in GitHub Desktop.
Docker-Compose update script
This file contains 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
#!/bin/bash | |
confirm() { | |
# call with a prompt string or use a default | |
read -r -p "${1:-Are you sure? [y/N]} " response | |
case "$response" in | |
[yY][eE][sS]|[yY]) | |
true | |
;; | |
*) | |
false | |
;; | |
esac | |
} | |
export DOCKER_CLIENT_TIMEOUT=120 | |
export COMPOSE_HTTP_TIMEOUT=120 | |
echo "Pulling latest contrainer images" && docker-compose pull && echo "Recreating updated contrainers" && docker-compose up -d && echo "Current docker disk usage" && docker system df && confirm "Would you like to prune dangling images? [y/N]" && docker system prune |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment