Registry/HUB API is buggy


I get {"error": "Requires authorization"} when I visit:


Returns [{"layer": "5b4b0828", "name": "latest"}]

In case of official repos, for example:

You get a 404.

But again {"error": "Requires authorization"} for:

So a bunch of questions:

  1. Why only 1 call succeeds? I think that all should succeed
  2. Why there is authorization without authentication?
  3. How to query the tags of a public repository?



you are talking with two different services, which have two different API’s. They look similar but are not. is the docker-registry used for storing images, this API is public, but requires authorization. is the “index” now called RegistryHub, this tags endpoint is not public, and might change at any time. I would not use this one, since it is for internal use only, and may change without warning.

Answers to your questions.

  1. It fails because you need authorization when talking with the registry.
  2. You need an auth token, which comes from the index/ registryHub, if you auth against the registryHub it will give you a token which you can use against the docker-registry.
  3. You would need to do what you have, but with an valid token to the docker-registry.

We hope to offer an official API in the future that will make all of this much easier. I don’t have an ETA on when this might be available.

I am trying to make this work - I understand what to do but the only trivial thing am stuck with is:

what are the “user credentials” one has to provide to the hub API to request the token?

In the doc as user credentials a string “QWxhZGRpbjpvcGVuIHNlc2FtZQ==” is shown - what string is this, where do I get it from?

The credentials are in

after having done a
sudo docker login

Ok after getting the token I am stuck. I have tried every possible way of supplying the token to the registry but it just keeps replying with 401, auth required. Here is the header which I am supplying to the registry server

‘set-cookie’: ‘csrftoken=Nwz7S…; Expires=Fri, 26 Feb 2016 21:14:18 GMT; Max-Age=31449600; Path=/; Secure’
‘www-authenticate’: ‘Token signature=Nwz7S…,repository=“ubuntu”,access=read’
‘x-docker-token’: 'Token signature=Nwz7S…,repository=“ubuntu”,access=read’
Authenticate: ‘Token signature=Nwz7S…,repository=“ubuntu”,access=read’

As you can see I am supplying the token every possible way I could think of, including supplying it as cookie as returned by the Hub. No luck. I tried to packet-sniff how the docker cli does it but had no luck either.

How to proceed?


I have had no luck resolving this issue - is the Docker registry API functioning at all?

If so, can anyone who is using it post a working code sample? Any framework / technology / language of your choice…