简体   繁体   English

如何防止docker搜索docker hub

[英]How to prevent docker from searching docker hub

I'm standing up a few docker hosts to run in a production environment. 我站在一些docker主机上运行在生产环境中。 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). 我们希望所有图像都必须通过我们的容器管道,我们不希望能够从Docker Hub中提取图像(安全问题)。

How can I stop docker being able to pull images from dockerhub? 如何阻止docker从dockerhub中提取图像? Ideally I would like to do this via configuring the docker daemon. 理想情况下,我希望通过配置docker守护程序来实现此目的。

I think it is not possible to prevent docker for searching docker hub.. 我认为不可能阻止docker搜索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. 在这种情况下,所有在docker hub上搜索都找不到任何东西。

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 为此:您必须将您的私有注册表URL(不带https://或http://)与您的图像名称连接起来,例如: FROM myprivate_registry/myimagename:if_versionFROM 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: 此外,你可以说docker使用你的私人注册表作为它的第一个注册表和docker hub将成为第二个:

`ADD_REGISTRY='--add-registry myregistry'` or `INSECURE_REGISTRY='--insecure-registry myregistry'`

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM