delete-docker-registry-image

Install

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

Run

Set up your data directory via an environment variable(根据自己安装目录配置环境变量):

find / -name registory

export REGISTRY_DATA_DIR=/opt/registry_data/docker/registry/v2

You can also just edit the script where this variable is set to make it work for your setup.

Almost delete a repo:

delete_docker_registry_image --image testrepo/awesomeimage --dry-run

Actually delete a repo (remember to shut down your registry first):

 

delete_docker_registry_image --image testrepo/awesomeimage

Delete one tag from a repo:

 

delete_docker_registry_image --image testrepo/awesomeimage:supertag

参考:https://github.com/burnettk/delete-docker-registry-image

本人遇到的问题:

 

 

 

 

 

 

 解决办法:查询raw.githubusercontent.com域名的真实IP

[root@docker~]#vim  /etc/hosts 
    
199.232.96.133 raw.githubusercontent.com

 

查询IP地址网址:https://www.ipaddress.com/