Caching images on docker proxy repository

I’ve followed along this blog Using Nexus OSS as a proxy/cache for Docker images – Tech by Maarten and created the daemon.json on docker mentioned and everything seems to be correctly configured but when I try to download an image it doesn’t cache into the proxy repository. I’ve create a hosted, proxy and group repository and when I use docker login, I connect to the group and try to pull an image, it always downloads from docker hub directly and I can’t cache it. What am I missing?

Hi,
You’re having the same issue I have.
I took a capture and saw that when using docker pull it first check that the repository support V2 and it does it anonymously even if you perform docker login
I also opened a case on that.

Are you including the Nexus Repo hostname and port when issuing docker commands?

https://help.sonatype.com/repomanager3/formats/docker-registry/accessing-repositories

Rich

Yes, I am. I’ve configured a proxy, hosted and group repository. Each has a different port number and I can push images without any issues for the hosted repository.

I have same problem but when use docker command give me error
Error response from daemon: Get http://127.0.0.1:8181/v2/: dial tcp 127.0.0.1:8181: connect: connection refused

i use last version w nexus oss 3.29.2 and how to check support v2 ?!

… but when I try to download an image it doesn’t cache into the proxy repository

There is a “Foreign Layer Caching” option in the settings of the proxy-repository. Did you try to set it?
https://help.sonatype.com/repomanager3/formats/docker-registry/foreign-layers

The blog article you mentioned was written for Nexus v3.15. “Foreign Layer Caching” option appeared in Nexus v3.19. In the sooner versions caching works by default, as i know.