# Caching images on docker proxy repository

**URL:** <https://community.sonatype.com/t/caching-images-on-docker-proxy-repository/3496>\
**Category:** Sonatype Nexus Repository\
**Created:** [February 14, 2020, 8:30pm UTC](https://community.sonatype.com/t/caching-images-on-docker-proxy-repository/3496 "2020-02-14T20:30:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ricardo.goncalves](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/ricardo.goncalves/32/1038_2.png) [@ricardo.goncalves](https://community.sonatype.com/u/ricardo.goncalves)\
**Post date:** [February 14, 2020, 8:30pm UTC](https://community.sonatype.com/t/caching-images-on-docker-proxy-repository/3496/1 "2020-02-14T20:30:29Z")

</div>

I’ve followed along this blog [Using Nexus OSS as a proxy/cache for Docker images – Tech by Maarten](https://mtijhof.wordpress.com/2018/07/23/using-nexus-oss-as-a-proxy-cache-for-docker-images/) 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?

---

<div class="post-metadata">

**Author:** ![hezis](https://avatars.discourse-cdn.com/v4/letter/h/edb3f5/32.png) [@hezis](https://community.sonatype.com/u/hezis)\
**Post date:** [February 17, 2020, 8:02am UTC](https://community.sonatype.com/t/caching-images-on-docker-proxy-repository/3496/2 "2020-02-17T08:02:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rseddon](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/rseddon/32/341_2.png) [@rseddon](https://community.sonatype.com/u/rseddon)\
**Post date:** [February 17, 2020, 3:10pm UTC](https://community.sonatype.com/t/caching-images-on-docker-proxy-repository/3496/3 "2020-02-17T15:10:32Z")

</div>

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

[https://help.sonatype.com/repomanager3/formats/docker-registry/accessing-repositories](https://help.sonatype.com/repomanager3/formats/docker-registry/accessing-repositories)

Rich

---

<div class="post-metadata">

**Author:** ![ricardo.goncalves](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/ricardo.goncalves/32/1038_2.png) [@ricardo.goncalves](https://community.sonatype.com/u/ricardo.goncalves)\
**Post date:** [February 18, 2020, 7:26pm UTC](https://community.sonatype.com/t/caching-images-on-docker-proxy-repository/3496/4 "2020-02-18T19:26:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![iliyan\_iliew](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/iliyan_iliew/32/1199_2.png) [@iliyan\_iliew](https://community.sonatype.com/u/iliyan_iliew)\
**Post date:** [January 29, 2021, 5:40am UTC](https://community.sonatype.com/t/caching-images-on-docker-proxy-repository/3496/5 "2021-01-29T05:40:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![iliyan\_iliew](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/iliyan_iliew/32/1199_2.png) [@iliyan\_iliew](https://community.sonatype.com/u/iliyan_iliew)\
**Post date:** [January 29, 2021, 5:48am UTC](https://community.sonatype.com/t/caching-images-on-docker-proxy-repository/3496/6 "2021-01-29T05:48:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![salykin](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/salykin/32/1893_2.png) [@salykin](https://community.sonatype.com/u/salykin)\
**Post date:** [June 16, 2021, 10:55am UTC](https://community.sonatype.com/t/caching-images-on-docker-proxy-repository/3496/7 "2021-06-16T10:55:09Z")

</div>

> … 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](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.
