Created
November 19, 2021 15:59
-
-
Save PetreVane/595de62af2eea0c32fbd213994d5803b to your computer and use it in GitHub Desktop.
This script will remove all your local Docker images. Useful when day-dreaming of the lost drive space, because of Docker π¬
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 | |
echo "This script will delete all your local Docker images! " | |
docker images | cut -c 45-59 |grep -v "IMAGE ID" > /tmp/images.names | |
for image in $(cat /tmp/images.names); do | |
docker rmi -f $image; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment