docker远程仓库镜像删除

 删除镜像对应的操作:

curl -I -XDELETE 私有仓库地址/v2/镜像名称/manifests/镜像对应sha256值

docker远程仓库镜像删除 - 人生如忘川 - 博客园1、 查看仓库中的镜像 2、 查看某个镜像的标签列表 3、 查看某个镜像的digest值 4、 删除某个镜像的某个版本 参考: https://segmentfault.com/q/101000000https://www.cnblogs.com/jxcool/p/12411209.html

1、 查看仓库中的镜像

curl -X GET http://registry.test.cn:5000/v2/_catalog |python -m json.tool

{ 
    "repositories": [
        "nginx",
        "grafana"
    ]
}

2、 查看某个镜像的标签列表

curl -X GET http://registry.test.cn:5000/v2/grafana/tags/list |python -m json.tool

{
    "name": "grafana",
    "tags": [
        "v3.11.82",
        "latest"
    ]
}

3、 查看某个镜像的digest值

curl  -I -X GET http://registry.test.cn:5000/v2/grafana/manifests/v3.11.82

HTTP/1.1 200 OK
Content-Length: 5805
Content-Type: application/vnd.docker.distribution.manifest.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 http://registry.test.cn:5000/v2/grafana/manifests/v3.11.82
或者
curl  -X DELETE http://registry.test.cn:5000/v2/grafana/manifests/sha256:2d6ff127dd79779c7a4c0e42975ddec4d7243019946e0a53084c8107a736f9e5

{"errors":[{"code":"UNSUPPORTED","message":"The operation is unsupported."}]}

参考:
docker删除仓库中的镜像问题 - SegmentFault 思否
参考官方文档:HTTP API V2 | Docker Documentation

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值