Skip to content

Instantly share code, notes, and snippets.

@niqdev
Last active December 5, 2023 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niqdev/bed665c84cff107efd42fcdfef371ee3 to your computer and use it in GitHub Desktop.
Save niqdev/bed665c84cff107efd42fcdfef371ee3 to your computer and use it in GitHub Desktop.
docker cleanup
# 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