<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>

CC BY-SA 4.0
2021-09-02T16:10:30.560Z
2021-09-02T16:10:30.560Z
Adam Winter
<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>

CC BY-SA 4.0
2021-09-02T05:02:18.403Z
It doesn't appear that changing the default registry is going to be supported: https://github.com/moby/moby/issues/7203
swysocki
CC BY-SA 4.0
2021-09-02T14:27:44.963Z
@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...
Alistair Hardy
<docker><artifactory><dockerhub>
A better way to not use dockerhub - permanent config within docker?
Alistair Hardy
# 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


---

