Last active
December 5, 2023 22:12
-
-
Save niqdev/bed665c84cff107efd42fcdfef371ee3 to your computer and use it in GitHub Desktop.
docker cleanup
This file contains hidden or 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
# deletes all containers including its volumes use | |
docker rm -vf $(docker ps -aq) | |
# delete dangling images <none> | |
docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi -f | |
# deletes all the images (remove all the containers first) | |
docker rmi -f $(docker images -aq) | |
# removes all unused containers, volumes, networks and images | |
docker system prune -a --volumes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment