如何在管理多个 Docker 代码仓库的 Docker 仓库中删除其中一个仓库?
已有 Docker 仓库 repo1
和 repo2
。
$ curl -X GET localhost:5000/v2/_catalog
{"repositories":["repo1", "repo2"]}
我想要移除仓库repo1
,以便 _catalog
列表中不再显示 repo1
,例如:
$ curl -X GET localhost:5000/v2/_catalog
{"repositories":["repo2"]}
目前,存储库 repo1
只有默认的 "latest"
镜像标签。
$ curl -X GET localhost:5000/v2/repo1/tags/list
{"name":"repo1","tags":["latest"]}
(也许这会影响删除 repo1
?)
我已经尝试过...
以下命令返回了404页面未找到
:
$ curl -X DELETE localhost:5000/v1/repositories/repo1
$ curl -X DELETE localhost:5000/v2/repositories/repo1
$ curl -X DELETE localhost:5000/v2/repo1
以下返回:{"errors":[{"code":"UNSUPPORTED","message":"该操作不受支持。"}]}
$ curl -X DELETE localhost:5000/v2/repo1/manifests/latest
使用版本
远程docker-registry为registry/2.0
curl -vX GET localhost:5000/v2/
< HTTP/1.1 200 OK
...
< Docker-Distribution-Api-Version: registry/2.0
...
和
$ /bin/registry github.com/docker/distribution v2.4.1
repo1
存储库不会在_catalog
中列出。 - JamesThomasMoon