无法从注册表中删除Docker Image [英] Can't delete Docker Image from Registry

查看:303
本文介绍了无法从注册表中删除Docker Image的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的私人注册表中删除一个docker的图像,我所做的步骤是:



我已经做了如何使用Docker注册表API V2从私人注册表中删除图像?建议并且不起作用




  • 我做了一个HEAD请求来获取Docker-Content-Digest



    curl --cacert〜/ Documents / certificates // ca.pem --key〜/ Documents / certificates // key.pem --cert〜/ Documents / certificates / certificate.p12 --pass certpass -I https:// myprivateregistry / v2 / imagename / manifest / tag


  • 然后使用上一步骤中的Dcker-content-digest,我做了一个删除请求:



    curl --cacert〜/ Documents / certificates // ca.pem --key〜/ Documents / certificates // key.pem --cert〜/ Documents / certificates / certificate.p12 --pass certpass --headerAccept:application / vnd.docker.distribution.manifest.v2 + json-X DELETE https:// myprivateregisty / v2 / imagename / manifestests / dockercontentdigestgotfrompreviousstep


  • 我收到这个错误:



    {errors:[{code:MANIFEST_UNKNOWN,message:manifest unknown}]} p>



解决方案

很有可能,这意味着你删除了清单,这是正确的第一步。要从磁盘删除实际数据,您需要在注册表主机上运行docker注册表垃圾收集器。

  docker exec -it注册表bin /注册表垃圾收集/etc/docker/registry/config.yml 

信息来自该评论



另外,作为一些adv,我想建议你检查我的 docker注册表Web UI =)那里可以从该用户界面删除注册表中的图像。


Hi I want to delete a docker image from my private registry the steps that I did was:

I already did what the solution of How can I use the Docker Registry API V2 to delete an image from a private registry? recommended and it did not work

  • I did a HEAD request to get the Docker-Content-Digest

    curl --cacert ~/Documents/certificates//ca.pem --key ~/Documents/certificates//key.pem --cert ~/Documents/certificates/certificate.p12 --pass certpass -I https://myprivateregistry/v2/imagename/manifests/tag

  • Then using the Dcker-content-digest from the previous step I did a delete request:

    curl --cacert ~/Documents/certificates//ca.pem --key ~/Documents/certificates//key.pem --cert ~/Documents/certificates/certificate.p12 --pass certpass --header "Accept: application/vnd.docker.distribution.manifest.v2+json" -X DELETE https://myprivateregisty/v2/imagename/manifests/dockercontentdigestgotfrompreviousstep

  • I got this error:

    {"errors":[{"code":"MANIFEST_UNKNOWN","message":"manifest unknown"}]}

解决方案

In all likelihood, it means, that you have deleted the manifest, and this is right first step. To delete actual data from disk, you need to run docker registry garbage collector on registry host machine.

docker exec -it registry bin/registry garbage-collect /etc/docker/registry/config.yml

The info is from that comment

Also, as some adv, I want to propose you to check my docker registry web UI =) There is the possibility to delete an images from registry right with that UI.

这篇关于无法从注册表中删除Docker Image的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆