curl -XGET -u admin:admin http://192.168.91.18:5000/v2/_catalog
{"repositories":["centos","debian","mysql","nginx","php"]}curl -s -XGET -u admin:admin http://192.168.91.18:5000/v2/_catalog | python -m json.tool
{
"repositories": [
"centos",
"debian",
"mysql",
"nginx",
"php"
]
}curl -XGET -u admin:admin http://192.168.91.18:5000/v2/centos/tags/list
{"name":"centos","tags":["latest","7"]}curl -s -XGET -u admin:admin http://192.168.91.18:5000/v2/centos/tags/list | python -m json.tool
{
"name": "centos",
"tags": [
"latest",
"7"
]
}{"errors":[{"code":"UNSUPPORTED","message":"The operation is unsupported."}]}HTTP/1.1 405 Method Not Allowed Content-Type: application/json; charset=utf-8 Docker-Distribution-Api-Version: registry/2.0 X-Content-Type-Options: nosniff Date: Fri, 18 Mar 2022 04:12:22 GMT Content-Length: 78
docker ps | grep registry
3745255afa90 registry "/entrypoint.sh /etc…" About an hour ago Up About an hour 0.0.0.0:5000->5000/tcp, :::5000->5000/tcp registry
docker exec -it 3745255afa90 sh
vi /etc/docker/registry/config.yml
version: 0.1 log: fields: service: registry storage: cache: blobdescriptor: inmemory filesystem: rootdirectory: /var/lib/registry # 增加这里的 delete 和 enabled ,注意 yaml 语法格式 # 如果有 delete ,并且 enable 为 true 表示已经开启了删除功能 delete: enabled: true http: addr: :5000 headers: X-Content-Type-Options: [nosniff] health: storagedriver: enabled: true interval: 10s threshold: 3
docker restart 3745255afa90
curl -I -XGET --header "Accept:application/vnd.docker.distribution.manifest.v2+json" \ -u admin:admin http://192.168.91.18:5000/v2/centos/manifests/latest
HTTP/1.1 200 OK Content-Length: 529 Content-Type: application/vnd.docker.distribution.manifest.v2+json Docker-Content-Digest: sha256:a1801b843b1bfaf77c501e7a6d3f709401a1e0c83863037fa3aab063a7fdb9dc Docker-Distribution-Api-Version: registry/2.0 Etag: "sha256:a1801b843b1bfaf77c501e7a6d3f709401a1e0c83863037fa3aab063a7fdb9dc" X-Content-Type-Options: nosniff Date: Fri, 18 Mar 2022 04:06:42 GMT
curl -I -XDELETE -u admin:admin \ http://192.168.91.18:5000/v2/centos/manifests/sha256:a1801b843b1bfaf77c501e7a6d3f709401a1e0c83863037fa3aab063a7fdb9dc
HTTP/1.1 202 Accepted Docker-Distribution-Api-Version: registry/2.0 X-Content-Type-Options: nosniff Date: Fri, 18 Mar 2022 04:24:23 GMT Content-Length: 0
curl -XGET -u admin:admin http://192.168.91.18:5000/v2/centos/tags/list
{"name":"centos","tags":["7"]}
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70003733/viewspace-2904063/ ,如需转载,请注明出处,否则将追究法律责任。