实验脚本
docker run -d -p 6000:5000 --restart=always --name registry registry:3
(
docker pull debian:13.3
docker tag debian:13.3 127.0.0.1:6000/test/hello/foo/debian:13.3
docker push 127.0.0.1:6000/test/hello/foo/debian:13.3
docker rmi debian:13.3
docker rmi 127.0.0.1:6000/test/hello/foo/debian:13.3
docker pull 127.0.0.1:6000/test/hello/foo/debian:13.3
)
13.3: Pulling from library/debian
Digest: sha256:2c91e484d93f0830a7e05a2b9d92a7b102be7cab562198b984a84fdbc7806d91
Status: Downloaded newer image for debian:13.3
docker.io/library/debian:13.3
The push refers to repository [127.0.0.1:6000/test/hello/foo/debian]
d16566b6c5a6: Pushed
13.3: digest: sha256:523f9ef87fef9521745426990636ccc7ea42bf8e3ddb3ac9083b385d0c714a89 size: 528
Untagged: debian:13.3
Untagged: 127.0.0.1:6000/test/hello/foo/debian:13.3
Untagged: 127.0.0.1:6000/test/hello/foo/debian@sha256:523f9ef87fef9521745426990636ccc7ea42bf8e3ddb3ac9083b385d0c714a89
13.3: Pulling from test/hello/foo/debian
Digest: sha256:523f9ef87fef9521745426990636ccc7ea42bf8e3ddb3ac9083b385d0c714a89
Status: Downloaded newer image for 127.0.0.1:6000/test/hello/foo/debian:13.3
127.0.0.1:6000/test/hello/foo/debian:13.3
curl -fsSL http://127.0.0.1:6000/v2/_catalog | jq
{
"repositories": [
"test/hello/foo/debian"
]
}
curl -fsSL http://127.0.0.1:6000/v2/test/hello/foo/debian/tags/list | jq
{
"name": "test/hello/foo/debian",
"tags": [
"13.3"
]
}
GET /v2/<name>/tags/list?n=<integer>&last=<integer>
注意:
– registry=注册表
– repository=仓库
也就是说在这个场景中仓库的名字就是 test/hello/foo/debian 而不是debian