How to prevent docker from searching docker hub

做~自己de王妃 提交于 2020-05-14 19:51:31

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/48079176/how-to-prevent-docker-from-searching-docker-hub

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!