删除registry镜像数据,以centos为例
注意:curl命令中的 “-u geostack-dib:” 参数为registry账号密码,请自行修改或删除
1、修改/etc/docker/registry/config.yml配置文件并重启registry
storage: delete: enabled: true
2、获取标签列表
curl -u geostack-dib:[email protected] http://172.16.103.118:5000/v2/centos/tags/list
3、获取镜像摘要digest
curl -u geostack-dib:[email protected] -I -H "Accept: application/vnd.docker.distribution.manifest.v2+json" http://172.16.103.118:5000/v2/centos/manifests/7.6.1810
4、根据digest删除镜像
curl -u geostack-dib:[email protected] -I -X DELETE http://172.16.103.118:5000/v2/centos/manifests/sha256:747b2de199b6197a26eb1a24d69740d25483995842b2d2f75824095e9d1d19eb
5、如果当前镜像的标签全部删除完毕则需要执行此步骤
docker exec registry rm -rf /var/lib/registry/docker/registry/v2/repositories/centos
6、调用registry gc清理无效blobs
docker exec registry registry garbage-collect /etc/docker/registry/config.yml
相关推荐
kuzilala 2020-07-26
PinkBean 2020-08-11
changecan 2020-11-19
ECSHOP专属建设 2020-11-13
88427810 2020-11-02
步知道 2020-10-27
Junzizhiai 2020-10-10
jackalwb 2020-10-05
小网管 2020-09-03
shiwenqiang 2020-09-14
85251846 2020-09-14
summerinsist 2020-08-21
87901735 2020-08-19
85407718 2020-08-09
MichelinMessi 2020-07-30
suosuo 2020-07-28
CARBON 2020-07-28
lizhengfa 2020-07-27
88427810 2020-07-26