Created
March 30, 2020 13:13
-
-
Save crallen/1ba9d262202addbb4ed154ebb2ac757e to your computer and use it in GitHub Desktop.
Script to stop and prune all Docker images
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 | |
CONTAINERS=$(docker container ls -aq) | |
if [ -n "$CONTAINERS" ]; then | |
docker -l debug container stop $CONTAINERS | |
docker -l debug container rm $CONTAINERS | |
fi | |
docker -l debug system prune -af |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment