中获取图像列表),但它们主要是针对私人注册表的,而不是DockerHub
的私人存储库。而存在。它不是内置的其他工具,因为注册表中的存储库列表不限于用户或组织。并且由于缩放,隐私和安全原因,大多数SaaS注册表都禁用了所有对所有存储库的API。使用,其命令看起来像:
hub-tool
$ hub-tool repo ls $user_or_org --format json
每个回购中的标签和标签
hub-tool
,那是:
其他工具在任何注册表中都可以使用,包括Google的起重机,Redhat的Skopeo和我自己的Regclient。$ hub-tool tag ls $org/$repo --format json
(在每个中,我都在使用JSON格式化,假设您想脚本脚本输出。)
$ crane ls $repo
$ skopeo list-tags docker://$reppo
$ regctl tag ls $repo
这些内容有不同的方式与您的拍照一起登录。
$ hub-tool login
$ crane auth login $registry
$ skopeo login $registry
$ regctl registry login $registry
卷曲,您需要登录以使用用户名和拍拍在那里获得令牌。这都是特定于中心的,因此我建议使用上述一种工具,而不是卷曲以便于其他注册表:
$ cat ./manifest-v2-auth.sh
#!/bin/sh
ref="${1:-library/ubuntu:latest}"
sha="${ref#*@}"
if [ "$sha" = "$ref" ]; then
sha=""
fi
wosha="${ref%%@*}"
repo="${wosha%:*}"
tag="${wosha##*:}"
if [ "$tag" = "$wosha" ]; then
tag="latest"
fi
token=$(curl -s "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${repo}:pull" \
-u "$username:$user_pat" \
| jq -r '.token')
curl -H "Authorization: Bearer $token" \
-s "https://registry-1.docker.io/v2/${repo}/tags/list" | jq .
使用您对API的PAT。 I.E. curl - -header“授权:携带者{your_pat}”https://hub.docker.com/v2/namespaces/library/repositories/nginx/tags