Skip to content

Instantly share code, notes, and snippets.

@subhajeet2107
Created October 8, 2018 14:16
Show Gist options
  • Save subhajeet2107/7b5cf5fb4cbc9fda19f44b60b415f313 to your computer and use it in GitHub Desktop.
Save subhajeet2107/7b5cf5fb4cbc9fda19f44b60b415f313 to your computer and use it in GitHub Desktop.
Cleanup Docker Containers with volume
#!/bin/sh
docker rm -f $(docker ps -qa)
docker volume rm $(docker volume ls -q)
cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico /opt/rke"
for dir in $cleanupdirs; do
echo "Removing $dir"
sudo rm -rf $dir
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment