Last active
February 23, 2024 10:44
-
-
Save packmad/167e59d85497be84500f568da4f921f1 to your computer and use it in GitHub Desktop.
Remove all docker images one liner
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
# enter in the bash of the first container | |
docker exec -it $(docker ps | head -n 2 | tail -n 1 | cut -d " " -f 1) bash | |
# delete all containers | |
docker ps -a | tail -n +2 | cut -d " " -f 1 | xargs docker rm | |
# delete all images | |
docker images | tail -n +2 | tr -s " " | cut -d " " -f 3 | xargs docker rmi -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment