title: Proxying docker hub using Sonatype Nexus using registry-mirrors
body: <p>Similar to <a href="https://stackoverflow.com/questions/28557384/docker-private-registry-with-mirror">Docker private registry with mirror</a> but I am using Sonatype Nexus which is similar <a href="https://stackoverflow.com/questions/58826325/nexus-registry-mirror-docker-hub-not-work">nexus registry mirror docker hub not work</a> but I am also using a secure password protected repository</p>
  <p>I have these settings in for the Docker daemon.</p>
  <pre><code>{
    &quot;registry-mirrors&quot;: [
      &quot;https://repo.myprivate.com&quot;
    ],
    &quot;insecure-registries&quot;: [],
    &quot;debug&quot;: true,
    &quot;experimental&quot;: false
  }
  </code></pre>
  <p>However, when I pull an image like <code>ubuntu</code> and look at the network access I see it is not hitting my server but the Docker Hub server.</p>
  <p>I am guessing it is because I don't have my authentication set up for the mirror but I don't know the setting to use.</p>
  <p>I also want to avoid doing <a href="https://stackoverflow.com/questions/39254652/proxy-private-docker-registry-using-nexus-3">proxy private docker registry using nexus 3</a> which changes the names of the images to add the address.</p>
  <p>To pull using the proxy I had to do <code>docker pull repo.myprivate.com/library/alpine</code> which I want to avoid.</p>
  <p>It seems like it prioritizes the official repository first before going to the registry-mirrors.</p>
  <p>Another thing I tried was to block off the IP addresses using Windows firewall, but it does not fall back to my private repo either.</p>