【发布时间】:2018-02-20 22:16:26
【问题描述】:
我是第一次使用 docker,我正在尝试实现这一点 - https://docs.docker.com/get-started/part2/#tag-the-image
在某个阶段,我试图通过此命令与 localhost 连接 -
$ curl http://localhost:4000
显示此错误-
curl: (7) Failed to connect to localhost port 4000: Connection refused
但是,我已经通过以下代码解决了这个问题 -
$ docker-machine ip default
$ curl http://192.168.99.100:4000
之后一切正常,但在最后一部分,我试图根据教程使用以下行来运行应用程序...
$ docker run -p 4000:80 anibar/get-started:part1
但是,我收到了这个错误
C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: driver failed programming external connectivity on endpoint goofy_bohr (63f5691ef18ad6d6389ef52c56198389c7a627e5fa4a79133d6bbf13953a7c98): Bind for 0.0.0.0:4000 failed: port is already allocated.
【问题讨论】: