docker system df
查看
root@ip-172-30-69-134 ~]# docker system df
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 41 1 10.66GB 10.63GB (99%)
Containers 1 1 0B 0B
Local Volumes 13 1 149.2MB 149.2MB (99%)
Build Cache 1952 0 165.7GB 165.7GB
可以看到 Build Cache 有 165.7GB 这么多。
docker builder prune'
清理
保留 480h 的 Build Cache, 清理其他的 Cache.
docker builder prune --filter 'until=480h'