Answers: <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>
  
Answers: CC BY-SA 4.0
Answers: 2019-11-13T11:33:08.147Z
Answers: 2019-11-13T12:50:55.270Z
Answers: 2019-11-13T12:50:55.270Z
Answers: Hedi Nasr
Body: <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>
  
Tags: <docker-registry>
Title: stop pulling a docker image from the public docker-hub registry
UserDisplayName: dev coding
ThreadText: # 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](https://github.com/moby/moby/issues/7203)). 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](https://stackoverflow.com/questions/33054369/how-to-change-the-default-docker-registry-from-docker-io-to-my-private-registry)).
  
  
  ---
  
  