当我收到EOF错误时,如何才能获得2个容器链接

时间:2015-04-21 21:19:01

标签: docker

我在我的机器上设置了docker-io,我的用户属于docker组,因此我可以毫不费力地运行docker镜像。我有一个基于节点的图像:0.10.38,可以这样运行:

docker run -d --name=original_node --expose=5858,8081 \
  -v /opt/users/pwebster:/opt/users/pwebster \
  pwebster/openacademy:v01 node --debug server.js \
  -c /opt/users/pwebster/orion/nodejs/search-orion.conf

这很好用。当我将第二个容器链接到第一个容器时,它失败并出现了一些含糊不清的错误:

docker run  --link=original_node:pw --name=link_node \
  -v /opt/users/pwebster:/opt/users/pwebster -ti \
  pwebster/openacademy:v01 /bin/bash -l

然后该命令返回错误:

FATA[0001] Post http:///var/run/docker.sock/v1.16/containers/9af64a9c282b3fbec613eec2f79f05b12919a5c558f722a0ccb292b2e96ec475/start: EOF. Are you trying to connect to a TLS-enabled daemon without TLS? 

这些配置没有任何特别之处,搜索会返回大量Are you trying to connect to a TLS-enabled daemon without TLS?,这似乎是默认的错误消息,但没有提到Post失败的" / start& #34;最后。

它只包含导致--link失败的docker run。任何提示都非常感谢。

编辑:docker -d -D log

当我第二次使用/bin/bash--link运行图片时,我在/var/log/docker

中获得以下内容
time="2015-04-22T08:49:19-04:00" level="debug" msg="Calling POST /containers/{name:.*}/start" 
time="2015-04-22T08:49:19-04:00" level="info" msg="POST /v1.16/containers/6f14a062cd1589d2c40238ec04042f54c7092702bad1a8ec977099aa3addfa67/start" 
time="2015-04-22T08:49:19-04:00" level="info" msg="-job allocate_interface(6f14a062cd1589d2c40238ec04042f54c7092702bad1a8ec977099aa3addfa67) = OK (0)" 
time="2015-04-22T08:49:19-04:00" level="info" msg="+job link(-I)" 
time="2015-04-22T08:49:19-04:00" level="info" msg="-job link(-I)" 
time="2015-04-22T08:49:19-04:00" level="info" msg="-job start(6f14a062cd1589d2c40238ec04042f54c7092702bad1a8ec977099aa3addfa67)" 
2015/04/22 08:49:19 http: panic serving @: strconv.ParseUint: parsing "5858,8081": invalid syntax
goroutine 73 [running]:
net/http.func·011()
    /usr/lib/golang/src/pkg/net/http/server.go:1100 +0xb7
runtime.panic(0xa38a20, 0xc2080e4600)
    /usr/lib/golang/src/pkg/runtime/panic.c:248 +0x18d
github.com/docker/docker/nat.Port.Int(0xc20863f300, 0xd, 0xc20863f30a)
    /builddir/build/BUILD/docker-1.4.1/_build/src/github.com/docker/docker/nat/nat.go:57 +0x98
github.com/docker/docker/daemon/networkdriver/bridge.LinkContainers(0xc2084f2f80, 0x7f25313d78a8)
[...snip...]
time="2015-04-22T08:49:19-04:00" level="debug" msg="Closing buffered stdin pipe" 
time="2015-04-22T08:49:19-04:00" level="debug" msg="attach: stdin: end" 
time="2015-04-22T08:49:19-04:00" level="debug" msg="attach: job 1 completed successfully" 
time="2015-04-22T08:49:19-04:00" level="debug" msg="attach: waiting for job 2/3" 
time="2015-04-22T08:49:19-04:00" level="debug" msg="attach: stdout: end" 
time="2015-04-22T08:49:19-04:00" level="debug" msg="attach: stderr: end" 

我猜其含义是它不像我的--expose=5858,8081

1 个答案:

答案 0 :(得分:1)

我将原始容器上的--expose=5858,8081更改为--expose=5858 --expose=8081,问题就消失了。

看起来我在滥用曝光标志。