【问题标题】:Trying docker in docker getting TCP connection refused error在 docker 中尝试 docker 获取 TCP 连接被拒绝错误
【发布时间】:2015-12-23 12:57:51
【问题描述】:

我正在尝试在 docker 中运行 docker 并得到 TCP 127.0.0.1:5000:连接被拒绝。有人可以解释为什么会发生这种情况以及我该如何解决。

这是我累的:

docker run -it --privileged --name docker-server-test -d docker:1.7-dind

docker run --rm --link docker-server:docker docker:1.7 pull my-server:5000/qe/busybox
Unable to find image 'docker:1.7' locally
Trying to pull repository docker.io/library/docker ... 1.7: Pulling from library/docker
f4fddc471ec2: Already exists 
da0daae25b21: Already exists 
413668359dd0: Already exists 
ab205815427f: Already exists 
e8ace195c6b6: Already exists 
2129588b76a3: Already exists 
63f71ebd654b: Already exists 
f3231b3888dd: Already exists 
d449c5a1e017: Already exists 

library/docker:1.7: The image you are pulling has been verified. 
Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:c3666cc6458e02d780492c75acf1b0bf3424c8dd6882361438a9b93b46c2aa55
Status: Downloaded newer image for docker.io/docker:1.7

Pulling repository my-server:5000/qe/busybox
Get http://localhost:5000/v1/repositories/qe/busybox/tags: dial tcp 127.0.0.1:5000: connection refused

【问题讨论】:

    标签: tcp docker


    【解决方案1】:

    看起来您正试图从运行在本地计算机上的注册表中提取图像——在这种情况下,当您指定 localhost 作为从中提取图像的位置时,它正试图从 localhost 中提取图像相对于 Docker 守护程序容器(这不是您的注册表正在侦听的位置)。您可能想改为从host-ip:5000/qe/busybox 中提取(可能类似于192.168.0.x:5000/qe/busybox)。

    【讨论】:

    • 感谢您的建议,这是我现在得到的 host-ip:5000/qe/busybox 使用默认标签:最新来自守护进程的错误响应:无法 ping 注册表端点 host-ip:5000/v0 v2 ping 尝试失败错误:获取host-ip:5000/v2:tls:收到长度为20527的超大记录v1 ping尝试失败并出现错误:获取host-ip:5000/v1/_ping:tls:收到长度为20527的超大记录
    • 您的注册表是否配置了 TLS 证书?
    【解决方案2】:

    你设置了环境变量吗?如果尚未设置,请根据您的操作系统设置以下 Docker 环境变量:

    1. DOCKER_HOST
    2. DOCKER_CERT_PATH
    3. DOCKER_TLS_VERIFY

    您可以从 docker 客户端获取这些详细信息

    docker-machine env default
    

    【讨论】:

      猜你喜欢
      • 2021-06-24
      • 2021-11-16
      • 2019-10-20
      • 1970-01-01
      • 1970-01-01
      • 2017-10-31
      • 2015-12-13
      • 2021-12-01
      • 1970-01-01
      相关资源
      最近更新 更多