virtuald/docker-registry-cache

Cache is not currently compatible with authentication

BuBuaBu opened this issue · 5 comments

Hello,

I follow the steps of the README to setup a private registry cache.
When I pull an image from the cache (docker pull cachehost/myprivateimage) the image is retrieved.
But the cache is still empty. The directory /cache/cc do not contain more file and size do not increase.

So when I pull again the same image, things are not faster.

Do you know how I can debug? What information I could provide?

Could you help me?

Vivien

Are you using a v1 registry? It won't work on a v1 registry.

There's a debugging option you can add to squid.conf... debug_options ALL,2 and then you docker exec -it CONTAINER_ID /bin/bash and look at /var/log/squid/cache.log. The logfile will show each cache decision and tell you why and show HTTP headers -- if your registry is sending things telling it not to cache, it won't cache.

Yes, it trying to proxify a V2 registry.
I will have a look to the debug option.

With debug_options ALL,2, I got
2016/07/13 09:37:01.507| store.cc(994) checkCachable: StoreEntry::checkCachable: NO: not cachable

So I put debug_options ALL,6 to get more details, and got:
2016/07/13 09:37:07.897| http.cc(418) cacheableReply: NO because Authenticated and server reply missing Cache-Control

I added this line to the squid config.
refresh_pattern . 0 20% 3600 ignore-auth
This is not secure, One may retrieve images without proper credential.

We do not authenticate access to our internal docker registry, so I'm not able to assist you with this issue. However, it appears that squid has support for caching stuff that is authenticated, see http://wiki.squid-cache.org/Features/Authentication

I welcome any changes or documentation you can contribute that would help others deal with this problem. :)

Any progress here?