繁体   English   中英

Spring 在 Docker 桌面上启动应用程序主机 Windows

[英]Spring Boot Application Host on Docker Desktop on Windows

I am using Docker Desktop Version 2.3.0.3 stable version I have Created on Simple Spring Boot Rest App with Get Controller that prints "HELLO" URL: http://localhost:8090/hello

我创建了简单的 Dockerfile ,其属性如下:

From openjdk:16-jdk
ADD target/Hello.war Hello.war
EXPOSE 8090
ENTRYPOINT ["java","-jar","Hello.war"]

因此,当我构建并运行此 docker 映像时,上面的 API 仅通过我的“本地主机”主机命中

我的运行命令:

docker run -d -p 8090:8090 docker_spectra

Please Help How I can expose this API to a remote server in the same network by binding through IP as we do by changing the server.xml in Tomcat Web Server.

请帮忙 !!!

使用Dockerfiledocker run命令的以下配置。 我可以访问 Azure 云中托管的 API。

FROM openjdk:11
ADD target/leavemodule*.jar leavemodule.jar
ENTRYPOINT ["java","-jar","/leavemodule.jar"]

docker run -d -p 8080:8080 --name leavemodule-service anandaili/leavemodule-service

You can see complete guide how I am building the docker image and deploying it here leavemodule and you can hit the swagger ui: http://13.95.3.6:8080/swagger-ui.html

暂无
暂无

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

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