在Mac系統後,我開始寄存器以下的deploy document:不能訪問`HTTP://172.17.0.2:5000`開始搬運工註冊表
docker run -d -p 5000:5000 --restart=always --name registry registry:2
,其IP是"IPAddress": "172.17.0.2"
,這是從命令docker inspect <cid>
但我不能telnet其端口:
$ telnet 172.17.0.2 5000
Trying 172.17.0.2...
telnet: connect to address 172.17.0.2: Can't assign requested address
telnet: Unable to connect to remote host
或者
$ curl http://172.17.0.2:5000
curl: (7) Couldn't connect to server
我ssh到容器檢查:
$ docker exec -it cda bash
[email protected]:/# netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp6 0 0 :::5000 :::* LISTEN
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
[email protected]:/# curl -I http://localhost:5000
HTTP/1.1 200 OK
Cache-Control: no-cache
Date: Fri, 11 Dec 2015 07:34:17 GMT
Content-Type: text/plain; charset=utf-8
[email protected]:/#
好像它結合tcp6
無法正常tcp
。
哪裏出錯?
這些說明適用於Linux ,而不是OSX。你在使用docker-machine還是boot2docker? –
是的,'docker'命令正在運行'docker machine' – Freewind