无法使用我的Docker映像访问Spring Boot [英] Can't access Spring Boot with my docker image

查看:70
本文介绍了无法使用我的Docker映像访问Spring Boot的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我根据 https://https://spring.io/上的步骤,使用Spring Boot创建了一个简单的docker镜像://spring.io/guides/gs/spring-boot-docker/.

显然该应用程序运行正常,但是我无法通过浏览器访问它.

Apparently the application is running normally, but I can not access it through the Browser.

要获取我的docker映像:docker push renanshin/gs-spring-boot-docker

To get my docker image: docker push renanshin/gs-spring-boot-docker

这是我的Docker映像的Spring Boot的映像.

Here's an image of the Spring Boot of my Docker image.

在我的Docker上初始化Spring Boot

推荐答案

查看OP提供的屏幕截图后,似乎

After looking at the screenshot provided by the OP, it seems @MarkRotteveel's comment is right.

即,OP正在Windows上运行Docker,可能使用Windows的Docker Toolbox(基于 docker机器的旧版本),并且在这种情况下, docker run-p 8080:8080…不会将该服务公开给Windows主机上的 127.0.0.1:8080 ,而是公开给另一个IP地址.

Namely, the OP is running Docker on Windows, probably using Docker Toolbox for Windows (the legacy distribution based on docker machine), and it happens that in this case, docker run -p 8080:8080 … won't expose the service to 127.0.0.1:8080 on the Windows host, but to a different IP address.

有关详细信息,请参见此在线文档页面该其他页面.

For details, see this page of the online doc and that other page.

这篇关于无法使用我的Docker映像访问Spring Boot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆