<p>You cannot change the default registry (see <a href="https://github.com/moby/moby/issues/7203" rel="nofollow noreferrer">this</a>). You have to specify which registry to use like this:</p>

<pre><code>docker pull myprivatereg:port/library/image
</code></pre>

<p>Or, in a Dockerfile:</p>

<pre><code>FROM myprivatereg:port/library/image
</code></pre>

<p>(This question was also asked in <a href="https://stackoverflow.com/questions/33054369/how-to-change-the-default-docker-registry-from-docker-io-to-my-private-registry">StackOverlow</a>).</p>

CC BY-SA 4.0
2019-11-13T11:33:08.147Z
2019-11-13T12:50:55.270Z
2019-11-13T12:50:55.270Z
Hedi Nasr
<p>Is there any way to stop pulling a docker image from the public docker-hub registry while building image locally. 
Note: We are maintaining a private registry that contains all the images. Only and only docker-engine should search for an image from the private registry and not from the public registry.</p>

<docker-registry>
stop pulling a docker image from the public docker-hub registry
dev coding
# stop pulling a docker image from the public docker-hub registry

(Asked by: username_0 on 2019-11-13)

Is there any way to stop pulling a docker image from the public docker-hub registry while building image locally.
Note: We are maintaining a private registry that contains all the images. Only and only docker-engine should search for an image from the private registry and not from the public registry.

**Tags:** docker-registry


---

## 1 answers

### Answer by username_1 on 2019-11-13. Score: 2

You cannot change the default registry (see this). You have to specify which registry to use like this:
docker pull myprivatereg:port/library/image

Or, in a Dockerfile:
FROM myprivatereg:port/library/image

(This question was also asked in StackOverlow).


---

