docker registry api

本文介绍了如何使用Docker Registry API删除镜像,包括启用删除API、获取tag引用、通过digest删除和执行garbage collector。还提到了在Registry v2.3及以后版本中必须使用digest进行删除,并提供了批量删除脚本和Linux查找命令的提示。
摘要由CSDN通过智能技术生成

remove registry

https://stackoverflow.com/questions/43666910/remove-docker-repository-on-remote-docker-registry

  1. enable DELETE API:

    1. by config.yml : storage.delete.enabled:true
    2. by env: -e REGISTRY_STORAGE_DELETE_ENABLED=true
  2. 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

  1. send DELETE /v2//manifests/sha256:xxx

  2. run garbage collector: bin/registry garbage-collect /etc/docker/registry/config.yml

  3. 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值