下载清理工具
github 官网:https://github.com/burnettk/delete-docker-registry-image
1 2
| curl https://raw.githubusercontent.com/burnettk/delete-docker-registry-image/master/delete_docker_registry_image.py | sudo tee /usr/local/bin/delete_docker_registry_image >/dev/null sudo chmod a+x /usr/local/bin/delete_docker_registry_image
|
安装python依赖
1 2
| 如果是python2.x,直接在命令提示符中用pip install futures语句安装。 如果是python3,不用安装也可以用,自带了
|
添加Registry环境
1
| export REGISTRY_DATA_DIR=/data/docker_registry/docker/registry/v2
|
查看repositories
1
| http://192.168.100.2:30100/v2/_catalog
|
根据repositories进行清理
1
| delete_docker_registry_image --image tbl
|