简体   繁体   中英

spring boot in docker container not reacting to connection

So I have been trying now for a long time to get this work. The problem is I am starting a spring boot application in a docker container, but for some odd reason, I cannot connect to it. When I start the container in the logs it tells that the tomcat server is serving on the port 8080:日志的图像

I started the image with the command:

sudo docker run -p 8080:8080 --name rest restcon

QA:

trying to connecting to it means trying in postman to connect to a rest endpoint which worked fine on the localhost, but on the server in a container doesn't.

Are you certain the Springboot application is running correctly in the container ? sudo docker exec -it rest bash will let you access the container, from there you can check if the application is running and is indeed accessible on 8080.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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