我在同一局域网内的另一台服务器上设置了一个不安全的注册表。有没有一种方法可以轻松列出不安全注册表中可用的图像?
最佳答案
我认为除了直接调用registry API之外,没有其他方法
$ curl http://localhost:5000/v2/_catalog
{"repositories":["myfirstimage","mysecondimage"]}
$ curl http://localhost:5000/v2/myfirstimage/tags/list
{"name":"myfirstimage","tags":["latest","toto"]}
有关完整列表,请使用jq:
for repository in $(curl -s http://localhost:5000/v2/_catalog | jq -r '.repositories[]'); do
curl -s http://localhost:5000/v2/${repository}/tags/list | jq -r '(.name + ":" + .tags[])'
done
myfirstimage:latest
myfirstimage:toto
mysecondimage:latest
关于docker - 如何在不安全的注册表中列出Docker镜像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44774171/