Created
July 7, 2021 11:58
-
-
Save Habetdin/2e3bcfd3c34715537d64b7846648e3ba to your computer and use it in GitHub Desktop.
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
# 1. Remove all containers including their volumes | |
docker rm -vf $(docker ps -a -q) | |
# 2. Remove all images | |
docker rmi -f $(docker images -a -q) | |
# (1) and (2) as an one-liner | |
export _DCKR=$(docker ps -a -q) && [ -n "$_DCKR" ] && docker rm -vf ${_DCKR[@]}; export _DCKR=$(docker images -a -q) && [ -n "$_DCKR" ] && docker rmi -f ${_DCKR[@]}; unset _DCKR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cleanup unused networks:
docker network prune