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

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

问题描述

我想从我的私人注册表中删除一个 docker 镜像,我执行的步骤是:

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

我已经做了如何使用Docker Registry API V2从私有注册表中删除镜像的解决方案? 推荐但没用

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

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

  • 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 -我 https://myprivateregistry/v2/imagename/manifests/tag

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

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

我收到此错误:

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

推荐答案

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

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

信息来自该评论

此外,作为一些建议,我想建议您检查我的 docker 注册表 Web UI =)可以使用该 UI 从注册表中删除图像.

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 映像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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