Docker Host can connect to URL but the Container running Docker on same host cannot

Hello All,

Hope I’m writing in correct section.

I’m new to Docker and as part of my POC, I have created an image of a Spring Boot application and deployed it to Docker daemon running on Linux server . I’m trying to invoke a SOAP Web service using a WSDL URL from my code.

Web service URL : http://<.remoteserver>:8080/AppRegisterWS?wsdl.

( Hiding the server name for security reason)

System Spec :

Docker version : 18.09.3, build 774a1f
OS : CentOS Linux 7
Type : Issue/Question

I ran a TELNET test to at port 8080 form my Linux server, which is success and also a CURL http://<.remoteserver>:8080/AppRegisterWS?wsdl which returns a valid WSDL. This application has Actuator endpoints enabled

However when I run my images, it fails to connect to the same WSDL URL which is success from my Linux host.

Am I missing anything that must configure somewhere to make my Docker Containers also have the same network connectivity as my Linux host does ?.

Based on documetation, I have tried using below command

‘docker run --network host -p 8080:8080 myapp’

Though with this command, my app starts fine, but when I run ‘docker ps -a’ command, my container does not have any port information attached and neither can I post a txn to my application from POSTMAN to test Actuator Health status of my app

Thanks in Advance.