Skip to content

Instantly share code, notes, and snippets.

@webern
Last active March 8, 2023 21:35
Show Gist options
  • Save webern/de521dbb46e10920052eb29085cf5146 to your computer and use it in GitHub Desktop.
Save webern/de521dbb46e10920052eb29085cf5146 to your computer and use it in GitHub Desktop.
Nuke Docker from Orbit

You can double-check the docker data directory with this, but I considered too dangerous to include in the rm -rf command.

docker info | grep 'Docker Root Dir' | grep -oE '/.*'

Nuke Docker from Orbit

sudo systemctl stop docker
sudo rm -rf /var/lib/docker
sudo systemctl start docker
docker rm -f $(docker ps -aq)
docker rmi -f $(docker images -aq)
docker system prune -af

List Non-Running Containers

docker ps -f "status=exited"

Delete Non-Running Containers

docker rm -f $(docker ps -f "status=exited" -q)

Delete all Kind Clusters

kind get clusters | xargs -t -n1 kind delete cluster --name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment