Li Zhang
Li Zhang

Reputation: 113

How to list docker images in insecure-registry

I setup a insecure-registry on another server within the same local network. Is there a way to easily list images available on the insecure-registry?

Upvotes: 0

Views: 1201

Answers (1)

zigarn
zigarn

Reputation: 11595

I don't think there is another way than directly calling the registry API

$ curl http://localhost:5000/v2/_catalog
{"repositories":["myfirstimage","mysecondimage"]}

$ curl http://localhost:5000/v2/myfirstimage/tags/list
{"name":"myfirstimage","tags":["latest","toto"]}

For a full listing, using 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

Upvotes: 6

Related Questions