越往下的,越要慎重
    列出无用的卷

    1. docker volume ls -qf dangling=true

    清理无用的卷,容器,镜像

    1. docker volume rm $(docker volume ls -qf dangling=true)
    2. docker rmi $(docker images | grep '^<none>' | awk '{print $3}')
    3. docker images --no-trunc | grep '<none>' | awk '{ print $3 }' \
    4. | xargs docker rmi
    5. docker system prune
    6. docker volume prune
    7. docker rm $(docker ps -q)
    8. docker rmi $(docker images -q)

    执行以下命令会彻底清除所有容器

    1. docker system prune -a -f
    2. 或者:
    3. docker rm -f $(docker ps -qa)
    4. rm -rf /var/lib/etcd /var/lib/cni /var/run/calico
    5. rm -rf /etc/kubernetes/ssl /etc/kubernetes/.tmp/
    6. rm -rf /opt/cni
    7. 或者:
    8. docker rm -f `docker ps -aq && rm -rf /var/lib/etcd /var/lib/cni /var/run/calico /etc/kubernetes/ssl /etc/kubernetes/.tmp/ /opt/cni`