Docker registry API

查询catalog

sudo curl -k -XGET https://www.registry.com/v2/_catalog

查询tags

sudo curl -k -XGET https://www.registry.com/v2//tags/list

删除镜像

# 查询镜像是否存在,以及tags
sudo curl -k -XGET https://user:passwd@www.registry.com/v2/debian/tags/list
# 获取digest参数
sudo curl -v --silent -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -XGET -k https://user:passwd@www.registry.com/v2/debian/manifests/jessie 2>&1 | grep Docker-Content-Digest | awk '{print $3}'
# 根据digest进行删除
sudo curl -X DELETE -k https://user:passwd@www.registry.com/v2/debian/manifests/sha256:a4a28eee3eb9698fef895484b2dbf1a2179e0f7b23408f5ebfc39b30bab031b4
# 数据清理
sudo docker exec registry /bin/registry garbage-collect /etc/docker/registry/config.yml
sudo docker exec registry rm -rf /data/docker/registry/v2/respositories/debian