本来打算使用AQL的排序功能查询镜像的ID,其对应的modified时间最大,然后限制个数为1就可以得到对应的信息。
基本步骤是
- 获取所有docker私有仓库
- 通过AQL获取所有私有仓库所有镜像名字(通过"name" : "manifest.json",可以过滤只有一项关于镜像信息。例如 : "items.find({"repo": "test"},{"name": "manifest.json"})")
- 通过AQL通过镜像名字和仓库名字和modified过滤,得到对应镜像ID
"items.find({"repo": "%s"},{"name": "%s"}).sort({"$desc" : ["modified"]}).limit(1)
结果报错,报错信息如下:
Server response: 400
Sorting is not supported by AQL in the open source version
免费版不支持该功能。那就只能通过第二步骤去除过滤信息,自己手动对modified进行排序过滤了。



