Answers: <p>How about setting the registry mirror, and then blocking blocking DNS to docker.io just to make sure it goes to your mirror?</p>
  <pre><code>#/etc/docker/daemon.json
  
  {
  &quot;registry-mirrors&quot;: [&quot;https://docker-virtual-stage.artifactory.mycompany.com&quot;]
  }
  </code></pre>
  <p>As this guy suggested:  <a href="https://stackoverflow.com/a/64158584/10664600">https://stackoverflow.com/a/64158584/10664600</a></p>
  
Answers: CC BY-SA 4.0
Answers: 2021-09-02T16:10:30.560Z
Answers: 2021-09-02T16:10:30.560Z
Answers: Adam Winter
Body: <p>I've searched the documentation for docker if this is possible and come up blank, but thought I'd pose the question here before shelving this.
  Is there a way to just tell Docker to use something other than dockerhub as a first port of call?</p>
  <p>We're using Artifactory's virtual repository to merge local and remote repositories into one convenient output, but my main gripe is having to say <code>docker pull docker-virtual-stage.artifactory.mycompany.com/centos</code> instead of just <code>docker pull centos</code>.</p>
  <p>Jfrogs method to get this endpoint seems over-complex \ not easily scaled up.</p>
  <p>TL;DR: Is there a better way to not use dockerhub while remaining user friendly?</p>
  
Comments: CC BY-SA 4.0
Comments: 2021-09-02T05:02:18.403Z
Comments: It doesn't appear that changing the default registry is going to be supported: https://github.com/moby/moby/issues/7203
Comments: swysocki
Comments: CC BY-SA 4.0
Comments: 2021-09-02T14:27:44.963Z
Comments: @swysocki it's a shame. I'd even consider it counter productive, but as docker is so established, I imagine they don't see a need to be more open...
Comments: Alistair Hardy
Tags: <docker><artifactory><dockerhub>
Title: A better way to not use dockerhub - permanent config within docker?
UserDisplayName: Alistair Hardy
ThreadText: # A better way to not use dockerhub - permanent config within docker?
  
  (Asked by: username_0 on 2021-08-31)
  
  I've searched the documentation for docker if this is possible and come up blank, but thought I'd pose the question here before shelving this.
  Is there a way to just tell Docker to use something other than dockerhub as a first port of call?
  
  We're using Artifactory's virtual repository to merge local and remote repositories into one convenient output, but my main gripe is having to say `docker pull docker-virtual-stage.artifactory.mycompany.com/centos` instead of just `docker pull centos`.
  
  Jfrogs method to get this endpoint seems over-complex \ not easily scaled up.
  
  TL;DR: Is there a better way to not use dockerhub while remaining user friendly?
  
  **Tags:** docker, artifactory, dockerhub
  
  > **Comments:**
  > **username_1**: It doesn't appear that changing the default registry is going to be supported: https://github.com/moby/moby/issues/7203  
  > **username_0**: @username_1 it's a shame. I'd even consider it counter productive, but as docker is so established, I imagine they don't see a need to be more open...  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2021-09-02. Score: 1
  
  How about setting the registry mirror, and then blocking blocking DNS to docker.io just to make sure it goes to your mirror?
  
  ```
  #/etc/docker/daemon.json
  
  {
  "registry-mirrors": ["https://docker-virtual-stage.artifactory.mycompany.com"]
  }
  
  ```
  
  As this guy suggested: <https://stackoverflow.com/a/64158584/10664600>
  
  
  ---
  
  