Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent docker from searching docker hub

I'm standing up a few docker hosts to run in a production environment. We want all of our images to have to go through our container pipeline and we do not want to be able to pull images from Docker Hub (security concerns).

How can I stop docker being able to pull images from dockerhub? Ideally I would like to do this via configuring the docker daemon.

like image 518
Aaron Avatar asked Jan 03 '18 14:01

Aaron


1 Answers

I think it is not possible to prevent docker for searching docker hub..

But it is possible to prevent/avoid pulling image from docker hub. And it this case, all searching on docker hub will find nothing.

To do it: you must concatenate your private registry url(without https:// or http://) with your image name like: FROM myprivate_registry/myimagename:if_version or FROM myprivate_registry:registry_port/myimagename:if_version

Also, you can say to docker to use your private registry as its first registry and docker hub will become the second:

`ADD_REGISTRY='--add-registry myregistry'` or `INSECURE_REGISTRY='--insecure-registry myregistry'`
like image 107
network_newbie Avatar answered Oct 22 '22 11:10

network_newbie