How to get a list of images on docker registry v2

kikicarbonell picture kikicarbonell · Jul 6, 2015 · Viewed 484.9k times · Source

I'm using docker registry v1 and I'm interested in migrating to the newer version, v2. But I need some way to get a list of images present on registry; for example with registry v1 I can execute a GET request to http://myregistry:5000/v1/search? and the result is:

{
  "num_results": 2,
  "query": "",
  "results": [
    {
      "description": "",
      "name": "deis/router"
    },
    {
      "description": "",
      "name": "deis/database"
    }
  ]
}

But I can't find on official documentation something similar to get a list of image on registry. Anybody knows a way to do it on new version v2?

Answer

jonatan picture jonatan · Jul 31, 2015

For the latest (as of 2015-07-31) version of Registry V2, you can get this image from DockerHub:

docker pull distribution/registry:master

List all repositories (effectively images):

curl -X GET https://myregistry:5000/v2/_catalog
> {"repositories":["redis","ubuntu"]}

List all tags for a repository:

curl -X GET https://myregistry:5000/v2/ubuntu/tags/list
> {"name":"ubuntu","tags":["14.04"]}