remove registry
https://stackoverflow.com/questions/43666910/remove-docker-repository-on-remote-docker-registry
-
enable DELETE API:
- by config.yml : storage.delete.enabled:true
- by env: -e REGISTRY_STORAGE_DELETE_ENABLED=true
-
get the tag reference via GET /v2//manifests/ (don’t forget to have Header Accept: application/vnd.docker.distribution.manifest.v2+json).
in response headers, you have docker-content-digest: sha256:xxx
-
send DELETE /v2//manifests/sha256:xxx
-
run garbage collector: bin/registry garbage-collect /etc/docker/registry/config.yml
-
remove files: rm -r /var/lib/registry/docker/registry/v2/repositories//
registry api
DELETE /v2/<name>/manifests/<reference>
/v2/python/manifests/
/v2/quay.io/coreos/flannel/manifests/
https://docker-hub.one-k.xyz/v2/quay.io/coreos/flannel/tags/list
https://docker-hub.one-k.xyz/v2/openstack.kolla/ubuntu-source-mariadb-clustercheck/manifests/wallaby
https://docker-hub.one-k.xyz/v2/openstack.kolla/ubuntu-source-mariadb-clustercheck/manifests/sha256:d9992cc4f3edd222c9871dac91fbdd3cb4cf47570f0038e4574781df77808eed
c0cd30b832e6
registry api
GET /v2/<name>/tags/list Tags Fetch the tags under the repository identified by name.
GET /v2/<name>/manifests/<reference> Manifest Fetch the manifest identified by name and reference where reference can be a tag or digest. A HEAD request can also be issued to this endpoint to obtain resource information without receiving all data.
和 我们 free_cicd 业务 场景 也没啥 任何 冲突, 这边 主要 针对 gpu 企业 生产, 单子 都是 100w 以上的, 我们 搞好 之后 想 卖 10w 以下的 普通办公 还有 家庭 共享高档 pc
test delete by http
Deleting an Image
An image may be deleted from the registry via its name and reference. A delete may be issued with the following request format:
DELETE /v2//manifests/
For deletes, reference must be a digest or the delete will fail. If the image exists and has been successfully deleted, the following response will be issued:
202 Accepted
Content-Length: None
If the image had already been deleted or did not exist, a 404 Not Found response will be issued instead.
Note When deleting a manifest from a registry version 2.3 or later, the following header must be used when HEAD or GET-ing the manifest to obtain the correct digest to delete:
简单讲 就是 version 2.3 or later,
必须 根据 digest 才可以 删除 image
curl -H

本文介绍了如何使用Docker Registry API删除镜像,包括启用删除API、获取tag引用、通过digest删除和执行garbage collector。还提到了在Registry v2.3及以后版本中必须使用digest进行删除,并提供了批量删除脚本和Linux查找命令的提示。
最低0.47元/天 解锁文章
624

被折叠的 条评论
为什么被折叠?



