简体   繁体   English

Docker中的默认私有注册表

[英]Default private registry in Docker

I need to set up my own private registry in Docker, to generally keep all internal Docker-images. 我需要在Docker中设置我自己的私有注册表,通常保留所有内部Docker镜像。

To make this easier, I want to have a setup internally where my Docker-images are called project/component , just like normal Docker-images you pull from https://index.docker.io/ . 为了使这更容易,我想在内部设置我的Docker图像被称为project/component ,就像你从https://index.docker.io/提取的普通Docker图像一样。

I am certain, that I will never grab images in this format from index.docker.io, all those images will come from our internal indexer. 我确信,我永远不会从index.docker.io中获取这种格式的图像,所有这些图像都来自我们的内部索引器。 Even the images in the format of imagename , like centos will be pulled from our internal repository. 即使在格式图像imagename ,像centos从我们的内部资料库拉。

So, is there a way for me to change out the default indexer? 那么,有没有办法让我更改默认索引器? Or at least change my private indexer from port 5000 to something that is tried as default; 或者至少将我的私有索引器从端口5000更改为默认尝试的东西; ie, to grab images from private_indexer.internal/repo_name instead of private_indexer.internal:5000/repo_name . 即,从private_indexer.internal/repo_name而不是private_indexer.internal:5000/repo_name获取图像。

Is putting index.docker.io in our own dns pointing to our internal ip the best solution? 将index.docker.io放在我们自己的dns中指向我们的内部ip是最好的解决方案吗?

You can use private_indexer.internal/repo_name without any issue. 您可以使用private_indexer.internal/repo_name而不会出现任何问题。 Just run registry container on port 80 (you can also add some reverse proxy like nginx or hipache in front and pass traffic from port 80 to 5000). 只需在端口80上运行注册表容器(您也可以在前面添加一些反向代理,如nginx或hipache,并将流量从端口80传递到5000)。 As for first part of question to change default index url you would probably need to change docker code and recompile. 至于更改默认索引url的问题的第一部分,您可能需要更改docker代码并重新编译。 I tried to do this quite few versions ago and it worked but back then there was no easy to use private registry support like now. 我试图在很少的版本之前做到这一点并且它起作用但当时没有像现在那样容易使用私有注册表支持。 So IMHO best would be to stick with tagging all private images with private registry url. 所以恕我直言最好的办法是坚持用私人注册网址标记所有私人图像。 Then you will not loose access to images in public index (ubuntu, busybox). 然后你不会失去对公共索引(ubuntu,busybox)中图像的访问权限。

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

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