[英]Tunnel or SSL Forbidden - Pulling a docker image from private registry
I've setup a private Docker registry on my PC and I'm able to pull and push the image to it and pull it back again if I use the following command : 我已经在PC上设置了一个私有Docker注册表,并且可以使用以下命令将映像推入并推入并再次拉回:
docker pull localhost:5000/new_buntu
But, if I replace localhost
with my IP address, it doesn't work. 但是,如果我用我的IP地址替换
localhost
,它将无法正常工作。
$ docker pull 10.118.56.140:5000/new_buntu
Using default tag: latest
Error response from daemon: Get https://10.118.56.140:5000/v2/: Tunnel or SSL Forbidden
Now an interesting observation is, if I want see the list of images inside my docker registry, I visit: 现在有趣的观察是,如果我想查看我的Docker注册表中的图像列表,请访问:
http://localhost:5000/v2/_catalog
which is an HTTP URL. 这是一个HTTP URL。 But, as seen in the output, when I try to pull an image using my IP address, it tries to connect over HTTPS.
但是,如输出所示,当我尝试使用IP地址提取图像时,它将尝试通过HTTPS连接。 I wonder if docker has some sort of setting that if the images is not being pulled from localhost, it'll force the SSL.
我想知道docker是否具有某种设置,即如果不从本地主机提取图像,它将强制使用SSL。 If so, how do I stop it?
如果是这样,我该如何停止呢?
I've tried putting "http" in the pull command but it didn't work: 我尝试将“ http”放在pull命令中,但没有成功:
$ docker pull http://10.118.56.140:5000/new_buntu
invalid reference format
I want all the people on my network to be able to fetch image from my registry. 我希望网络中的所有人都可以从注册表中获取图像。 How do I do it?
我该怎么做?
Took me a little effort exploring this issue but finally I figured it out. 我花了点力气探索这个问题,但最终我想出了办法。 Docker, as it seems, does force SSL if the image is being pulled from a remote machine.
看起来,如果从远程计算机提取映像,则Docker会强制使用SSL。 To prevent this behavior, we need to specifically tell docker that the registry we're trying to connect to isn't SSLized.
为了防止这种行为,我们需要特别告知docker我们尝试连接的注册表未经过SSL加密。 Follow these steps to configure the docker image for it:
请按照以下步骤为其配置docker映像:
Issue the following command to pull the image. 发出以下命令来拉取图像。
docker pull IP_Address:Port_Number/Image_Name 码头工人拉IP_地址:端口号/图像名称
For eg: 例如:
docker pull 10.118.56.140:5000/new_buntu
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.