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