/var/lib/doc/overlay 2 takes up a lot of space, how to deal with it?

  docker, question
sudo du -ah --max-depth=1 /var/lib/docker
 
 4.0K    /var/lib/docker/runtimes
 4.0K    /var/lib/docker/swarm
 3.0G    /var/lib/docker/containers
 520K    /var/lib/docker/containerd
 4.0K    /var/lib/docker/trust
 104K    /var/lib/docker/network
 9.6M    /var/lib/docker/image
 20K    /var/lib/docker/plugins
 867M    /var/lib/docker/volumes
 6.7G    /var/lib/docker/overlay2
 4.0K    /var/lib/docker/tmp
 20K    /var/lib/docker/builder
 72K    /var/lib/docker/buildkit
 11G    /var/lib/docker
 
 sudo docker system df
 
 TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
 Images              10                  10                  3.035GB             115MB (3%)
 Containers          10                  10                  211.9MB             0B (0%)
 Local Volumes       27                  2                   906.8MB             866.4MB (95%)
 Build Cache         0                   0                   0B                  0B

/var/lib/docker/overlay2The occupied space is very large and vps space is limited. How to deal with this situation?

Docker system df -v looks at larger images. if there are images that need not be used, you can consider deleting the free space.

For details, please read this blog:
https://yq.aliyun.com/article …