找了一圈,没有找到简单的方法。
我具体描述一下我的需求:仓库有四个分支 current_feature, master, pre_production, production,其中 master 跟环境没有任何关系。current_feature 对应 dev 环境,pre_production 对应 pre_production 环境,production 对应 production 环境。镜像的标签是 current_feature-latest, current_feature-{shortCommitHash}, pre_production-latest, pre_production-{shortCommitHash}, production-latest, production-{shortCommitHash}。我想删除掉旧的镜像,包含非latest 和旧shortCommitHash 的镜像。
https://github.com/andrey-pohilko/registry-cli
https://github.com/ricardobranco777/clean_registry
我们的 registry 用的这俩,自动删除超过 30 天的镜像