Last active
September 27, 2022 04:56
-
-
Save obazoud/6413369 to your computer and use it in GitHub Desktop.
Remove docker image without tag
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 | |
sudo docker stop $(docker ps -a -q) | |
sudo docker rm $(docker ps -a -q) | |
sudo docker ps -a | grep 'months ago' | awk '{print $1}' | xargs sudo docker rm | |
sudo docker images | grep "\<none\>" | awk '{ print $3 }' | xargs sudo docker rmi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment