docker工尝试docker在获取TCP连接拒绝错误

我试图在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 

它看起来像你试图从本地机器上运行的registry中拉出一个图像 – 在这种情况下,当你指定localhost作为拉图像的地方,它试图从localhost相对于Docker守护进程容器这不是你的registry正在侦听的地方)。 你可能想从host-ip:5000/qe/busybox取出(可能类似于192.168.0.x:5000/qe/busybox )。

你有envvariables集? 根据您的操作系统,设置以下Docker envvariables(如果尚未设置):

  1. DOCKER_HOST
  2. DOCKER_CERT_PATH
  3. DOCKER_TLS_VERIFY

你可以从你的docker客户端获得这些细节

 docker-machine env default