简体   繁体   English

无法使用我的Docker映像访问Spring Boot

[英]Can't access Spring Boot with my docker image

I'm created a simple docker image with Spring Boot based on steps at https://spring.io/guides/gs/spring-boot-docker/ . 我根据https://spring.io/guides/gs/spring-boot-docker/上的步骤使用Spring Boot创建了一个简单的docker映像。

Apparently the application is running normally, but I can not access it through the Browser. 显然,该应用程序运行正常,但是我无法通过浏览器访问它。

To get my docker image: docker push renanshin/gs-spring-boot-docker 获取我的docker镜像:docker push renanshin / gs-spring-boot-docker

Here's an image of the Spring Boot of my Docker image. 这是我的Docker镜像的Spring Boot的镜像。

Initialization of Spring Boot at my docker 在我的Docker上初始化Spring Boot

After looking at the screenshot provided by the OP, it seems @MarkRotteveel's comment is right. 看完OP提供的屏幕截图后, @ MarkRotteveel的评论似乎正确。

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. 即,OP正在Windows上运行Docker,可能使用Windows的Docker Toolbox(基于docker machine的旧发行版),并且碰巧在这种情况下, docker run -p 8080:8080 …不会将服务公开给127.0.0.1:8080 Windows主机上的127.0.0.1:8080 ,但使用其他IP地址。

For details, see this page of the online doc and that other page . 有关详细信息,请参见在线文档的此页面其他页面

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM