我在同一本地网络中的另一台服务器上设置了一个不安全的注册表。有没有办法轻松列出insecure-registry上可用的图像?
答案 0 :(得分:4)
我认为除了直接调用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