我是第一次使用Docker,我正在尝试实现这个操作 - https://docs.docker.com/get-started/part2/#tag-the-image
在某个阶段,我尝试使用以下命令连接本地主机 -
$ 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.