1. 必备条件

镜像仓库打开可删除功能

2. 清理镜像

1
2
3
4
5
# curl -k -I -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -I http://localhost:5000/v2/openshift/ocp-router/manifests/v3.11.129
获取镜像层的sha256值
# curl -X DELETE http://localhost:5000/v2/openshift/ocp-router/manifests/sha256:39ad17c3e10f902d8b098ee5128a87d4293b6d07cbc2d1e52ed9ddf0076e3cf9
# #登录到镜像仓库
# registry garbage-collect /etc/docker-distribution/registry/config.yml

3. 参考文档

私有docker registry的使用–push,pull,search,delete