remove docker repository on remote docker registry

泄露秘密 提交于 2020-01-03 17:47:11

问题


Given a docker registry managing multiple docker repositories, how do I delete one of the repositores?

In my case,

curl -X GET localhost:5000/v2/_catalog
{"repositories":["repo1", "repo2", "repo3"]}

I want to remove repository repo1 so that _catalog looks like

curl -X GET localhost:5000/v2/_catalog
{"repositories":["repo2", "repo3"]}

We can see repo1 appears to have only the default "latest" image tag.

curl -X GET localhost:5000/v2/repo1/tags/list
{"name":"repo1","tags":["latest"]}

(Maybe that affects being able to delete repo1?)



I have tried...

The following commands returned 404 page not found:

curl -X DELETE localhost:5000/v1/repositories/repo1
curl -X DELETE localhost:5000/v2/repositories/repo1
curl -X DELETE localhost:5000/v2/repo1

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

curl -X DELETE localhost:5000/v2/repo1/manifests/latest

Using

The docker-registry is registry/2.0

curl -vX GET localhost:5000/v2/
< HTTP/1.1 200 OK
...
< Docker-Distribution-Api-Version: registry/2.0
...

and

/bin/registry github.com/docker/distribution v2.4.1

回答1:


The error {"errors":[{"code":"UNSUPPORTED","message":"The operation is unsupported."}]} indicates that you don't have delete enabled in your registry server. See this documentation for how to enable the option. In your configuration of the registry, you would add the following section:

delete:
  enabled: true


来源:https://stackoverflow.com/questions/43666910/remove-docker-repository-on-remote-docker-registry

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!