我可以安装Docker镜像并从DockerHub运行,但无法显示映射的URL(已关闭)。

huangapple go评论72阅读模式
英文:

I am able to install docker image & run from dockerhub, but mapping url does not shown (closed)

问题

I'm using Docker Toolbox on Windows 7, and when I run a command like 'docker run -p 5000:5000 -d in28min/todo-rest-api-h2:1.0.0.RELEASE', it worked and the app executed.

-- Here it shows that the app has started.

Besides, the 'docker container ls' command gives me the running port.

So, when I request the corresponding URL (http://localhost:5000/hello-world), it does not respond (This site can't be reached). What can be the problem here? As far as I know, the '-p' command allows us to request. Thanks in advance.

英文:

I m using docker toolbox in Windows 7, and when I run a command like
'docker run -p 5000:5000 -d in28min/todo-rest-api-h2:1.0.0.RELEASE'
, it worked and app executed.

我可以安装Docker镜像并从DockerHub运行,但无法显示映射的URL(已关闭)。

-- Here is shown that app started.

我可以安装Docker镜像并从DockerHub运行,但无法显示映射的URL(已关闭)。

Besides 'docker container ls' command give me running port.
我可以安装Docker镜像并从DockerHub运行,但无法显示映射的URL(已关闭)。

So, when I request to corresponding URL(http://localhost:5000/hello-world), it does not respond (This site can’t be reached). What can be a problem here? As far as I know, that '-p' command allows us to request. Thanks in advance

答案1

得分: 0

我找到了解决方案。这是因为 'docker-machine ip' 不同于 Docker 工具箱。默认的 docker-machine IP 是 192.168.99.100,而不是 localhost。

英文:

I found solution. It is because of 'docker-machine ip'. which is different in docker toolbox. Default docker-machine ip is 192.168.99.100, not localhost.

huangapple
  • 本文由 发表于 2020年8月11日 23:10:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/63361134.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定