删除镜像对应的操作:
curl -I -XDELETE 私有仓库地址/v2/镜像名称/manifests/镜像对应sha256值
docker远程仓库镜像删除 - 人生如忘川 - 博客园1、 查看仓库中的镜像 2、 查看某个镜像的标签列表 3、 查看某个镜像的digest值 4、 删除某个镜像的某个版本 参考: /q/101000000https:///jxcool/p/
1、 查看仓库中的镜像
curl -X GET :5000/v2/_catalog |python -m { "repositories": [ "nginx", "grafana" ] }
2、 查看某个镜像的标签列表
curl -X GET :5000/v2/grafana/tags/list |python -m { "name": "grafana", "tags": [ "v3.11.82", "latest" ] }
3、 查看某个镜像的digest值
curl -I -X GET :5000/v2/grafana/manifests/v3.11.82 HTTP/1.1 200 OK Content-Length: 5805 Content-Type: application/.v1+prettyjws Docker-Content-Digest: sha256:2d6ff127dd79779c7a4c0e42975ddec4d7243019946e0a53084c8107a736f9e5 Docker-Distribution-Api-Version: registry/2.0 Etag: "sha256:2d6ff127dd79779c7a4c0e42975ddec4d7243019946e0a53084c8107a736f9e5" Date: Wed, 04 Mar 2020 09:48:38 GMT
4、 删除某个镜像的某个版本
curl -X DELETE :5000/v2/grafana/manifests/v3.11.82 或者 curl -X DELETE :5000/v2/grafana/manifests/sha256:2d6ff127dd79779c7a4c0e42975ddec4d7243019946e0a53084c8107a736f9e5 {"errors":[{"code":"UNSUPPORTED","message":"The operation is unsupported."}]}
参考:
docker删除仓库中的镜像问题 - SegmentFault 思否
参考官方文档:HTTP API V2 | Docker Documentation