简体   繁体   English

禁止隧道或SSL-从私有注册表中提取Docker映像

[英]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映像:

  1. Right Click on the docker's icon in the icon bar. 右键单击图标栏中的Docker图标。

在此处输入图片说明

  1. Click on “Settings”. 点击“设置”。

在此处输入图片说明

  1. Go to the “Daemon” Tab in the Settings Panel. 转到“设置”面板中的“守护程序”选项卡。

在此处输入图片说明

  1. Add the registry's IP address and port number in “Insecure registries” section. 在“不安全的注册表”部分中添加注册表的IP地址和端口号。 (10.118.56.140:5000 in my case) (在我的情况下为10.118.56.140:5000)

在此处输入图片说明

  1. Open a browser and visit http://:/v2/_catalog to see the list of all the available images. 打开浏览器,然后访问http://:/ v2 / _catalog以查看所有可用图像的列表。 ( http://10.118.56.140:5000/v2/_catalog in my case) (就我而言, http://10.118.56.140:5000/v2/_catalog

在此处输入图片说明

  1. 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.

相关问题 Kubernetes-从私有Docker注册表中提取错误 - Kubernetes - Error pulling from a private docker registry Kubernetes 不从私有注册表中拉取镜像 - Kubernetes not pulling image from private registry Kubernetes 不从 JFrog 私有注册表中提取图像 - Kubernetes not pulling image from JFrog private registry Docker-swarm自动从私有docker-registry中提取丢失的图像 - Docker-swarm automatically pulling missing image from private docker-registry Docker 私有注册表镜像 - 禁止 - Docker Private Registry Mirror - Forbidden 从私有 docker 注册表中拉取图像会导致摘要 sha256 的文件系统层验证失败: - pulling image from private docker registry causes filesystem layer verification failed for digest sha256: 在 Airflow 2.0 中使用 DockerOperator 从 GitLab 容器注册表中拉取私有 docker 图像时出错 - Error when pulling private docker image from GitLab container registry using DockerOperator in Airflow 2.0 Docker:从另一台服务器的私有注册表中提取问题 - Docker: Issue with pulling from a private registry from another server Docker 在 Kubernetes 中提取没有 ssl 的映像,带有 Z05B6053C41A2130AFD6FC3B16 - Docker pull image without ssl in Kubernetes with docker private registry `docker pull` 从私有 gitlab 注册表返回 `denied: access forbidden` - `docker pull` returns `denied: access forbidden` from private gitlab registry
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM