从命令行获取可用的docker标签列表?
我想获得一些Docker镜像发布的版本/标签的基本信息,知道我可以拖拽哪些image:tag。 我也想看看每个标签最近发布的时间。
有没有办法在命令行上做到这一点?
Docker version 1.10.2, build c3959b1
基本上寻找相当于一个泊坞窗图像的npm info {pkg}
。
不从命令行。 你有docker search
但它只返回你想要的数据的一个子集,只有带有:latest
标签的图像:
> docker search sixeyed/hadoop-dotnet NAME DESCRIPTION STARS OFFICIAL AUTOMATED sixeyed/hadoop-dotnet Hadoop with .NET Core installed 1 [OK]
如果您想了解更多详细信息,则需要使用registryAPI ,但只有列出存储库的目录端点,search问题仍处于打开状态。
假设您知道存储库名称,可以导航API – 首先需要身份validation令牌:
> curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:sixeyed/hadoop-dotnet:pull" {"token":"eyJhbG...
然后,将令牌传递给后续请求,例如列出标签:
> curl --header "Authorization: Bearer eyJh..." https://index.docker.io/v2/sixeyed/hadoop-dotnet/tags/list {"name":"sixeyed/hadoop-dotnet","tags":["2.7.2","latest"]}
然后通过其存储库名称和标签获取关于一个图像的所有信息:
> curl --header "Authorization: Bearer eyJh..." https://index.docker.io/v2/sixeyed/hadoop-dotnet/manifests/latest