我正在写,因为我遇到了一个似乎没有得到解决的问题,我会重视社区的帮助。
我正在尝试将图像推送到我在端口 5000 上部署的本地注册表。
当我使用此命令docker push localhost:5000/explorecalifornia.com将图像推送到本地注册表时,我收到以下消息
Get "http://localhost:5000/v2/": net/http: request canceled (Client.Timeout exceeded while awaiting headers)
我已通过在邮递员上使用 GET 确认注册表位于端口 5000 上,并且我得到了有效的预期{}响应(因为我的本地注册表上目前没有图像)。
我已经尝试通过更新我的文件以根据这篇文章的etc/hosts建议注释掉“::1 localhost”来解决这个问题。这是我文件的内容etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
# ::1 localhost
# Added by Docker Desktop
# To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal
# End of section
etc/resolve.conf根据这篇文章的建议,我还使用以下名称服务器更新了我的文件。
nameserver 10.0.2.3
nameserver 8.8.8.8
nameserver 8.8.4.4
这些都不起作用。有没有人也遇到过这个问题?有什么建议可以帮助解决这个问题吗?
如果有帮助,这里是源代码!先感谢您 :)