Created
June 24, 2022 00:15
-
-
Save ElijahLynn/15a31d51618c5a4805a1d660f24f005e to your computer and use it in GitHub Desktop.
docker-nuke (fish)
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
## https://stackoverflow.com/questions/34658836/docker-is-in-volume-in-use-but-there-arent-any-docker-containers?answertab=trending#comment128478332_42116347 | |
function docker-remove-containers --description "Remove all docker containers" | |
docker stop (docker ps --all --quiet) | |
docker rm (docker ps --all --quiet) | |
end | |
funcsave docker-remove-containers | |
function docker-nuke --description "Remove all Docker networks, containers, volumes and images." | |
docker-remove-containers | |
docker network prune --force | |
docker rmi --force (docker images --filter dangling=true --quiet --all) | |
docker volume rm (docker volume ls --filter dangling=true --quiet) | |
docker rmi --force (docker images --quiet --all) | |
end | |
funcsave docker-nuke |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment