Docker Registry(包括 Harbor)默认没有可以直观查看使用空间的工具,registry-du 这个工具就可以用来统计 Registry 的 Project 空间占用。例如:
安装
pip3 install registry-du
用法
registry-du /path/to/registry/docker/registry/v2
示例
➜ registry-du /home/X/du-demo/registry/data/docker/registry/v2
Registry Path is: /home/X/du-demo/registry/data/docker/registry/v2
+Project-Size----------+-----------+
| Project Name | Size(MiB) |
+----------------------+-----------+
| jellyfin | 277.55 |
| library | 147.62 |
| mongo-express:latest | 47.2 |
+----------------------+-----------+
+Image-Size----------------+-----------+
| Image Name | Size(MiB) |
+--------------------------+-----------+
| jellyfin/jellyfin:latest | 277.55 |
| library/mysql:5.7 | 147.62 |
| mongo-express:latest | 47.2 |
+--------------------------+-----------+