我能够安装docker映像并从dockerhub运行,但映射网址未显示已关闭

问题描述

我在Windows 7中使用docker工具箱,并且在运行类似 'docker run -p 5000:5000 -d in28min/todo-rest-api-h2:1.0.0.RELEASE' ,它可以正常运行,并且可以执行应用。

enter image description here

-这里显示该应用已启动。

enter image description here

除了“ docker container ls”命令外,还提供了我正在运行的端口。

enter image description here

因此,当我请求相应的URL(http://localhost:5000/hello-world)时,它没有响应(无法访问此网站)。这里可能有什么问题?据我所知,'-p'命令允许我们请求。预先感谢

解决方法

我找到了解决方案。这是因为“ docker-machine ip”。这在docker工具箱中有所不同。默认的docker-machine ip是192.168.99.100,而不是localhost。